mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-13 02:52:35 +01:00
Remove useless checks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user