From 80977e1e0d04ac25f325da20bbcaa0dceb8d7624 Mon Sep 17 00:00:00 2001 From: matheusvb3 <98937378+matheusvb3@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:06:25 -0300 Subject: [PATCH] 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 --- src/openrct2/entity/Peep.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 602f0b4948..dbcf8b1770 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -266,21 +266,24 @@ void Peep::UpdateWaitingAtCrossing() if (auto* guest = As(); 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();