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

Fix #11343, 11344. Remove all peeps cheat causes a crash/hang (#11345)

* Fix #11343, 11344. Remove all peeps cheat causes a crash/hang

Caused by a refactor.

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
Duncan
2020-04-18 19:43:05 +01:00
committed by GitHub
parent 523e6ca4a0
commit 6570741a1c
2 changed files with 6 additions and 3 deletions

View File

@@ -685,9 +685,12 @@ private:
}
}
Peep* peep;
FOR_ALL_GUESTS (spriteIndex, peep)
// Do not use the FOR_ALL_PEEPS macro for this as next sprite index
// will be fetched on a deleted peep.
for (spriteIndex = gSpriteListHead[SPRITE_LIST_PEEP]; spriteIndex != SPRITE_INDEX_NULL;)
{
auto peep = GET_PEEP(spriteIndex);
spriteIndex = peep->next;
peep->Remove();
}

View File

@@ -31,7 +31,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 "3"
#define NETWORK_STREAM_VERSION "4"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;