Introduce peep flags for static positions and animations

This commit is contained in:
Aaron van Geffen 2024-06-29 14:42:09 +02:00
parent fb4c1451e4
commit ed6bde7d56
5 changed files with 21 additions and 2 deletions

View file

@ -2743,7 +2743,9 @@ declare global {
"joy" |
"angry" |
"iceCream" |
"hereWeAre";
"hereWeAre" |
"positionFrozen" |
"animationFrozen";
/**
* @deprecated since version 34, use EntityType instead.

View file

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

View file

@ -956,6 +956,11 @@ static void GuestUpdateThoughts(Guest* peep)
*/
void Peep::Update()
{
if (PeepFlags & PEEP_FLAGS_POSITION_FROZEN)
{
return;
}
auto* guest = As<Guest>();
if (guest != nullptr)
{

View file

@ -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
};

View file

@ -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