From fcb9a407f5635f6f1bc077b371009ded01ae0f2e Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Tue, 27 May 2014 18:28:24 +0100 Subject: [PATCH] fix peep loop bug --- src/peep.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/peep.c b/src/peep.c index f64ee2679a..cde8015f4e 100644 --- a/src/peep.c +++ b/src/peep.c @@ -53,8 +53,12 @@ void peep_update_all() if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0E) return; + spriteIndex = RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_START_PEEP, uint16); i = 0; - FOR_ALL_PEEPS(spriteIndex, peep) { + while (spriteIndex != SPRITE_INDEX_NULL) { + peep = &(RCT2_ADDRESS(RCT2_ADDRESS_SPRITE_LIST, rct_sprite)[spriteIndex].peep); + spriteIndex = peep->next; + if ((i & 0x7F) != (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 0x7F)) { RCT2_CALLPROC_X(0x0068FC1E, 0, 0, 0, 0, (int)peep, 0, 0); } else {