mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 23:33:04 +01:00
Check if guest action is interruptable
This fixes a bug where the waving or eating animations for the guests could suddenly reset while it was already playing
This commit is contained in:
@@ -266,21 +266,24 @@ void Peep::UpdateWaitingAtCrossing()
|
|||||||
|
|
||||||
if (auto* guest = As<Guest>(); guest != nullptr)
|
if (auto* guest = As<Guest>(); guest != nullptr)
|
||||||
{
|
{
|
||||||
if (guest->HasFoodOrDrink())
|
if (guest->IsActionInterruptable())
|
||||||
{
|
{
|
||||||
if ((ScenarioRand() & 0xFFFF) <= 1310)
|
if (guest->HasFoodOrDrink())
|
||||||
{
|
{
|
||||||
Action = PeepActionType::eatFood;
|
if ((ScenarioRand() & 0xFFFF) <= 1310)
|
||||||
|
{
|
||||||
|
Action = PeepActionType::eatFood;
|
||||||
|
AnimationFrameNum = 0;
|
||||||
|
AnimationImageIdOffset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((ScenarioRand() & 0xFFFF) <= 64)
|
||||||
|
{
|
||||||
|
Action = PeepActionType::wave2;
|
||||||
AnimationFrameNum = 0;
|
AnimationFrameNum = 0;
|
||||||
AnimationImageIdOffset = 0;
|
AnimationImageIdOffset = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((ScenarioRand() & 0xFFFF) <= 64)
|
|
||||||
{
|
|
||||||
Action = PeepActionType::wave2;
|
|
||||||
AnimationFrameNum = 0;
|
|
||||||
AnimationImageIdOffset = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateCurrentAnimationType();
|
UpdateCurrentAnimationType();
|
||||||
|
|||||||
Reference in New Issue
Block a user