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

Fix #7239: Remove all guests cheat crashes with ferris wheel

This commit is contained in:
deurklink
2018-03-08 09:20:32 +01:00
committed by Michael Steenbeek
parent ad4e50d728
commit 87bdd4d079
2 changed files with 7 additions and 4 deletions

View File

@@ -374,10 +374,13 @@ static void cheat_remove_all_guests()
while (spriteIndex != SPRITE_INDEX_NULL)
{
vehicle = GET_VEHICLE(spriteIndex);
for (size_t i = 0; i < vehicle->num_peeps; i++)
for (size_t i = 0, offset = 0; i < vehicle->num_peeps; i++)
{
peep = GET_PEEP(vehicle->peep[i]);
while (vehicle->peep[i + offset] == SPRITE_INDEX_NULL)
{
offset++;
}
peep = GET_PEEP(vehicle->peep[i + offset]);
vehicle->mass -= peep->mass;
}

View File

@@ -33,7 +33,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "37"
#define NETWORK_STREAM_VERSION "38"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static rct_peep* _pickup_peep = nullptr;