diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index f335ab7716..e1bcce131a 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -2743,7 +2743,9 @@ declare global { "joy" | "angry" | "iceCream" | - "hereWeAre"; + "hereWeAre" | + "positionFrozen" | + "animationFrozen"; /** * @deprecated since version 34, use EntityType instead. diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 85b1b7e48a..5e4b89230e 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -979,7 +979,10 @@ void Guest::Tick128UpdateGuest(uint32_t index) } } - UpdateSpriteType(); + if (!(PeepFlags & PEEP_FLAGS_ANIMATION_FROZEN)) + { + UpdateSpriteType(); + } if (State == PeepState::OnRide || State == PeepState::EnteringRide) { @@ -1009,6 +1012,11 @@ void Guest::Tick128UpdateGuest(uint32_t index) } } + if (PeepFlags & PEEP_FLAGS_POSITION_FROZEN) + { + return; + } + if (State == PeepState::Walking && !OutsideOfPark && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && GuestNumRides == 0 && GuestHeadingToRideId.IsNull()) { diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index d1a2a7cb33..53868dc28e 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -956,6 +956,11 @@ static void GuestUpdateThoughts(Guest* peep) */ void Peep::Update() { + if (PeepFlags & PEEP_FLAGS_POSITION_FROZEN) + { + return; + } + auto* guest = As(); if (guest != nullptr) { diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index ae934c8522..b559ae7be5 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -227,6 +227,8 @@ enum PeepFlags : uint32_t PEEP_FLAGS_INTAMIN_DEPRECATED = (1 << 27), // Used to make the peep think "I'm so excited - It's an Intamin ride!" while // riding on a Intamin ride. PEEP_FLAGS_HERE_WE_ARE = (1 << 28), // Makes the peep think "...and here we are on X!" while riding a ride + PEEP_FLAGS_POSITION_FROZEN = (1 << 29), // Prevents the peep from moving around, thus keeping them in place + PEEP_FLAGS_ANIMATION_FROZEN = (1 << 30), // Prevents the peep sprite from updating PEEP_FLAGS_TWITCH_DEPRECATED = (1u << 31), // Formerly used for twitch integration }; diff --git a/src/openrct2/scripting/bindings/entity/ScPeep.hpp b/src/openrct2/scripting/bindings/entity/ScPeep.hpp index 2ccbb5f4d7..9ad34699f3 100644 --- a/src/openrct2/scripting/bindings/entity/ScPeep.hpp +++ b/src/openrct2/scripting/bindings/entity/ScPeep.hpp @@ -41,6 +41,8 @@ namespace OpenRCT2::Scripting { "angry", PEEP_FLAGS_ANGRY }, { "iceCream", PEEP_FLAGS_ICE_CREAM }, { "hereWeAre", PEEP_FLAGS_HERE_WE_ARE }, + { "positionFrozen", PEEP_FLAGS_POSITION_FROZEN }, + { "animationFrozen", PEEP_FLAGS_ANIMATION_FROZEN }, }); class ScPeep : public ScEntity