1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-16 04:22:43 +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; PeepFlags &= ~PEEP_FLAGS_ANIMATION_FROZEN;
} }
auto* guest = As<Guest>(); if (!PreviousRide.IsNull())
if (guest != nullptr)
{ {
if (!guest->PreviousRide.IsNull()) if (++PreviousRideTimeOut >= 720)
if (++guest->PreviousRideTimeOut >= 720) {
guest->PreviousRide = RideId::GetNull(); PreviousRide = RideId::GetNull();
}
GuestUpdateThoughts(guest);
} }
GuestUpdateThoughts(this);
// Walking speed logic // Walking speed logic
uint32_t stepsToTake = Energy; uint32_t stepsToTake = Energy;
if (stepsToTake < 95 && State == PeepState::Queuing) if (stepsToTake < 95 && State == PeepState::Queuing)
@@ -5319,10 +5319,7 @@ void Guest::Update()
StepProgress = carryCheck; StepProgress = carryCheck;
if (carryCheck <= 255) if (carryCheck <= 255)
{ {
if (guest != nullptr) UpdateEasterEggInteractions();
{
guest->UpdateEasterEggInteractions();
}
} }
else else
{ {
@@ -5342,25 +5339,8 @@ void Guest::Update()
UpdatePicked(); UpdatePicked();
break; break;
default: default:
{ UpdateGuest();
if (guest != nullptr)
{
guest->UpdateGuest();
}
else
{
auto* staff = As<Staff>();
if (staff != nullptr)
{
staff->UpdateStaff(stepsToTake);
}
else
{
assert(false);
}
}
break; break;
}
} }
} }
} }

View File

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