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 committed 2025-12-07 10:35:58 -03:00
1 parent 646d16e745
commit 80977e1e0d
1 file changed
+12 -9
+12 -9
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();