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

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

No files matched your search

+6 -3
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;
}
+1 -1
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;