From 2f2a03fe1f820cd5bacb7c680ce63e1be0bf0aee Mon Sep 17 00:00:00 2001 From: qcz Date: Tue, 9 Sep 2014 19:38:19 +0200 Subject: [PATCH] fix crash of scenery window when selecting the first entry of a given type --- src/window_scenery.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/window_scenery.c b/src/window_scenery.c index 86d3cbcdd8..886fd5b083 100644 --- a/src/window_scenery.c +++ b/src/window_scenery.c @@ -706,15 +706,15 @@ static void window_scenery_update(rct_window *w) sint16 tabSelectedSceneryId = window_scenery_selected_scenery_by_tab[tabIndex]; if (tabSelectedSceneryId != -1) { - if (tabSelectedSceneryId > 0x400) { // banner + if (tabSelectedSceneryId >= 0x400) { // banner RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = 0x18; - } else if (tabSelectedSceneryId > 0x300) { // large scenery + } else if (tabSelectedSceneryId >= 0x300) { // large scenery RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = g_largeSceneryEntries[tabSelectedSceneryId - 0x300]->large_scenery.tool_id; - } else if (tabSelectedSceneryId > 0x200) { // wall + } else if (tabSelectedSceneryId >= 0x200) { // wall RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = g_wallSceneryEntries[tabSelectedSceneryId - 0x200]->wall.tool_id; - } else if (tabSelectedSceneryId > 0x100) { // path bit + } else if (tabSelectedSceneryId >= 0x100) { // path bit RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TOOL, uint8) = g_pathBitSceneryEntries[tabSelectedSceneryId - 0x100]->path_bit.tool_id; } else { // small scenery