diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index b078aa4aeb..dbc59609ba 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1228,7 +1228,7 @@ void Guest::TryGetUpFromSitting() */ void Guest::UpdateSitting() { - if (SubState == PEEP_SITTING_TRYING_TO_SIT) + if (SittingSubState == PeepSittingSubState::TryingToSit) { if (!CheckForPath()) return; @@ -1248,12 +1248,12 @@ void Guest::UpdateSitting() NextActionSpriteType = PEEP_ACTION_SPRITE_TYPE_SITTING_IDLE; SwitchNextActionSpriteType(); - SubState = PEEP_SITTING_SAT_DOWN; + SittingSubState = PeepSittingSubState::SatDown; // Sets time to sit on seat TimeToSitdown = (129 - Energy) * 16 + 50; } - else if (SubState == PEEP_SITTING_SAT_DOWN) + else if (SittingSubState == PeepSittingSubState::SatDown) { if (Action < PEEP_ACTION_NONE_1) { @@ -6106,7 +6106,7 @@ bool Guest::UpdateWalkingFindBench() SetState(PEEP_STATE_SITTING); - SubState = PEEP_SITTING_TRYING_TO_SIT; + SittingSubState = PeepSittingSubState::TryingToSit; int32_t benchX = (x & 0xFFE0) + BenchUseOffsets[Var37 & 0x7].x; int32_t benchY = (y & 0xFFE0) + BenchUseOffsets[Var37 & 0x7].y; diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 66d7d46442..64f1cb6ea9 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -242,10 +242,10 @@ enum PeepState : uint8_t PEEP_STATE_INSPECTING = 23 }; -enum PeepSittingSubState +enum class PeepSittingSubState : uint8_t { - PEEP_SITTING_TRYING_TO_SIT = 0, - PEEP_SITTING_SAT_DOWN + TryingToSit, // was = 0 + SatDown // was unassigned }; enum PeepRideSubState @@ -614,7 +614,11 @@ struct Peep : SpriteBase uint8_t NextFlags; bool OutsideOfPark; PeepState State; - uint8_t SubState; + union + { + uint8_t SubState; + PeepSittingSubState SittingSubState; + }; PeepSpriteType SpriteType; PeepType AssignedPeepType; union