Close #12389: Refactor PeepSittingSubState (#12908)

* Refactor PeepSittingSubState

* Fix formatting
This commit is contained in:
rpstester authored and GitHub committed 2020-09-14 20:11:17 +01:00
1 parent 2857f9d276
commit f7348b1f06
2 files changed
+12 -8

No files matched your search

+4 -4
View File
@@ -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;
+8 -4
View File
@@ -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