mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
* Refactor PeepSittingSubState * Fix formatting
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user