1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-13 02:52:35 +01:00

Remove useless checks

This commit is contained in:
ζeh Matt
2025-05-21 17:23:30 +03:00
parent f475ef050f
commit db23e69597
2 changed files with 11 additions and 56 deletions

View File

@@ -5288,16 +5288,16 @@ void Guest::Update()
PeepFlags &= ~PEEP_FLAGS_ANIMATION_FROZEN;
}
auto* guest = As<Guest>();
if (guest != nullptr)
if (!PreviousRide.IsNull())
{
if (!guest->PreviousRide.IsNull())
if (++guest->PreviousRideTimeOut >= 720)
guest->PreviousRide = RideId::GetNull();
GuestUpdateThoughts(guest);
if (++PreviousRideTimeOut >= 720)
{
PreviousRide = RideId::GetNull();
}
}
GuestUpdateThoughts(this);
// Walking speed logic
uint32_t stepsToTake = Energy;
if (stepsToTake < 95 && State == PeepState::Queuing)
@@ -5319,10 +5319,7 @@ void Guest::Update()
StepProgress = carryCheck;
if (carryCheck <= 255)
{
if (guest != nullptr)
{
guest->UpdateEasterEggInteractions();
}
UpdateEasterEggInteractions();
}
else
{
@@ -5342,25 +5339,8 @@ void Guest::Update()
UpdatePicked();
break;
default:
{
if (guest != nullptr)
{
guest->UpdateGuest();
}
else
{
auto* staff = As<Staff>();
if (staff != nullptr)
{
staff->UpdateStaff(stepsToTake);
}
else
{
assert(false);
}
}
UpdateGuest();
break;
}
}
}
}

View File

@@ -1706,11 +1706,6 @@ void Staff::Update()
PeepFlags &= ~PEEP_FLAGS_ANIMATION_FROZEN;
}
auto* guest = As<Guest>();
if (guest != nullptr)
{
}
// Walking speed logic
uint32_t stepsToTake = Energy;
if (stepsToTake < 95 && State == PeepState::Queuing)
@@ -1732,10 +1727,7 @@ void Staff::Update()
StepProgress = carryCheck;
if (carryCheck <= 255)
{
if (guest != nullptr)
{
guest->UpdateEasterEggInteractions();
}
// No-op: Keep replay working for now, can be eliminate with a replay update.
}
else
{
@@ -1755,25 +1747,8 @@ void Staff::Update()
UpdatePicked();
break;
default:
{
if (guest != nullptr)
{
guest->UpdateGuest();
}
else
{
auto* staff = As<Staff>();
if (staff != nullptr)
{
staff->UpdateStaff(stepsToTake);
}
else
{
assert(false);
}
}
UpdateStaff(stepsToTake);
break;
}
}
}
}