Fix #13234: Wrong vehicle weight after using Remove All Guests cheat

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2024-05-29 01:29:43 +02:00
1 parent 6ac6db489c
commit fc0b5fde27
2 files changed
+7 -1

No files matched your search

+1
View File
@@ -22,6 +22,7 @@
- Change: [#21214] Wacky Worlds and Time Twister’s scenario names now match their park names.
- Change: [#21991] UI themes JSON now use colour names and a translucency bool, instead of a number (old themes still work).
- Change: [#22057] Reorder Time Twister’s scenarios and adjust their difficulty classification.
- Fix: [#13234] Vehicle weight sometimes wrong after using Remove All Guests cheat.
- Fix: [#13294] Map corners are cut off in some directions (original bug).
- Fix: [#14630] Non-ASCII thousands and decimal separators not processed correctly.
- Fix: [#21974] No reason specified when attempting to place benches, lamps, or bins on path with no unconnected edges (original bug).
+6 -1
View File
@@ -711,10 +711,14 @@ void CheatSetAction::RemoveAllGuests() const
for (Vehicle* vehicle = TryGetEntity<Vehicle>(trainIndex); vehicle != nullptr;
vehicle = TryGetEntity<Vehicle>(vehicle->next_vehicle_on_train))
{
auto i = 0;
for (auto& peepInTrainIndex : vehicle->peep)
{
if (i >= vehicle->num_peeps)
break;
auto peep = TryGetEntity<Guest>(peepInTrainIndex);
if (peep != nullptr)
if (peep != nullptr && peep->CurrentRide == ride.id)
{
if ((peep->State == PeepState::OnRide && peep->RideSubState == PeepRideSubState::OnRide)
|| (peep->State == PeepState::LeavingRide && peep->RideSubState == PeepRideSubState::LeaveVehicle))
@@ -723,6 +727,7 @@ void CheatSetAction::RemoveAllGuests() const
}
}
peepInTrainIndex = EntityId::GetNull();
i++;
}
vehicle->num_peeps = 0;