From 67656a46a95ccb0cab8d315fee3720bc40a02c1d Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 29 Apr 2015 12:03:18 +0200 Subject: [PATCH 1/2] Fix land tool size staying in window after unselect land ownership tool --- src/windows/map.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/windows/map.c b/src/windows/map.c index 2efeb2caf7..2a02256038 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -369,14 +369,17 @@ static void window_map_mouseup() */ static void window_map_mousedown(int widgetIndex, rct_window*w, rct_widget* widget) { - // The normal map window doesn't have widget 8 or 9. - // I assume these widgets refer to the Scenario Editor's map window. - if (widgetIndex == 8) { + // These widgets all refer to the Scenario Editor's map window. + if (widgetIndex == WIDX_MAP_SIZE_SPINNER_UP) { RCT2_CALLPROC_X(0x0068D641, 0, 0, 0, widgetIndex, (int)w, 0, 0); } - else if (widgetIndex == 9) { + else if (widgetIndex == WIDX_MAP_SIZE_SPINNER_DOWN) { RCT2_CALLPROC_X(0x0068D6B4, 0, 0, 0, widgetIndex, (int)w, 0, 0); } + else if (widgetIndex == WIDX_SET_LAND_RIGHTS) + { + RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 1; + } } /** From d21cc0f73105b949e14157818dbe0c0041be7a2a Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 29 Apr 2015 12:09:52 +0200 Subject: [PATCH 2/2] Add extra comment --- src/windows/map.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/windows/map.c b/src/windows/map.c index 2a02256038..742f9e5809 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -378,6 +378,8 @@ static void window_map_mousedown(int widgetIndex, rct_window*w, rct_widget* widg } else if (widgetIndex == WIDX_SET_LAND_RIGHTS) { + // When unselecting the land rights tool, reset the size so the number doesn't + // stay in the map window. RCT2_GLOBAL(RCT2_ADDRESS_LAND_TOOL_SIZE, sint16) = 1; } }