From 6db3828f32069b472348ba65887e68f7fc0483e6 Mon Sep 17 00:00:00 2001 From: zsilencer Date: Sun, 15 May 2016 06:21:19 -0600 Subject: [PATCH] Fix #3609: Crash from invalid peep --- src/peep/peep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/peep/peep.c b/src/peep/peep.c index 4eac6de29f..f536601eb1 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -1578,7 +1578,8 @@ void remove_peep_from_queue(rct_peep* peep) return; } - for (rct_peep* other_peep = GET_PEEP(ride->last_peep_in_queue[cur_station]);; + for (rct_peep* other_peep = GET_PEEP(ride->last_peep_in_queue[cur_station]); + ride->last_peep_in_queue[cur_station] != 0xFFFF; other_peep = GET_PEEP(other_peep->next_in_queue)){ if (peep->sprite_index == other_peep->next_in_queue){ other_peep->next_in_queue = peep->next_in_queue;