1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 01:22:25 +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:
matheusvb3
2025-10-06 21:06:25 -03:00
parent 646d16e745
commit 80977e1e0d

View File

@@ -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();