forked from rosebudai/OpenRCT2-Web
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:
1 parent
646d16e745
commit
80977e1e0d
1 file changed
+12
-9
@@ -266,21 +266,24 @@ void Peep::UpdateWaitingAtCrossing()
|
||||
|
||||
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;
|
||||
AnimationImageIdOffset = 0;
|
||||
}
|
||||
}
|
||||
else if ((ScenarioRand() & 0xFFFF) <= 64)
|
||||
{
|
||||
Action = PeepActionType::wave2;
|
||||
AnimationFrameNum = 0;
|
||||
AnimationImageIdOffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateCurrentAnimationType();
|
||||
|
||||
Reference in new issue
Block a user