From 03dd026ba0c1aebe255687707e83a8935027d402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Fri, 17 Feb 2017 08:36:34 +0100 Subject: [PATCH] Fix invalid bounds check in game_command_set_staff_order --- src/openrct2/peep/staff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/peep/staff.c b/src/openrct2/peep/staff.c index 6725f712e4..d197541e21 100644 --- a/src/openrct2/peep/staff.c +++ b/src/openrct2/peep/staff.c @@ -406,7 +406,7 @@ void game_command_set_staff_order(sint32 *eax, sint32 *ebx, sint32 *ecx, sint32 if(order_id & 0x80){ // change costume uint8 sprite_type = order_id & ~0x80; sprite_type += 4; - if (sprite_type > countof(peep_slow_walking_types)) { + if (sprite_type >= countof(peep_slow_walking_types)) { log_error("Invalid change costume order for sprite_type %u", sprite_type); *ebx = MONEY32_UNDEFINED; return;