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:
DuncanandTulio Leao authored and GitHub committed 2020-04-18 15:43:05 -03:00
1 parent 523e6ca4a0
commit 6570741a1c
2 files changed
+6 -3

No files matched your search

+5 -2
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();
}
+1 -1
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;