1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 03:05:24 +01:00

Fix #13234. Check for correct peep state when removing mass (#13983)

* Check for correct peep state when removing mass

* Add apply mass function

* Increment network version

* Fix #13234. Add to changelog
This commit is contained in:
Duncan
2021-02-03 09:13:56 +00:00
committed by GitHub
parent c35b1cf423
commit 9d3f3fa224
5 changed files with 15 additions and 4 deletions

View File

@@ -644,7 +644,11 @@ void SetCheatAction::RemoveAllGuests() const
auto peep = TryGetEntity<Guest>(peepInTrainIndex);
if (peep != nullptr)
{
vehicle->mass -= peep->Mass;
if ((peep->State == PeepState::OnRide && peep->RideSubState == PeepRideSubState::OnRide)
|| (peep->State == PeepState::LeavingRide && peep->RideSubState == PeepRideSubState::LeaveVehicle))
{
vehicle->ApplyMass(-peep->Mass);
}
}
peepInTrainIndex = SPRITE_INDEX_NULL;
}