From 06114c211650cdf85f450d0fda68c0967e5193d4 Mon Sep 17 00:00:00 2001 From: qcz Date: Tue, 19 Aug 2014 22:16:05 +0200 Subject: [PATCH 1/2] Fix #316 --- src/window_research.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/window_research.c b/src/window_research.c index 1e286830d7..bce8c52442 100644 --- a/src/window_research.c +++ b/src/window_research.c @@ -378,19 +378,23 @@ static void window_research_development_paint() y = w->y + window_research_development_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12; uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32); + int latDevelopmentFormat; if (typeId != 0xFFFFFFFF) { if (typeId >= 0x10000) { uint8 *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, uint8*); - if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000) - stringId = RCT2_GLOBAL(rideEntry, uint16); - else - stringId = (typeId & 0xFF00) + 2; + if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000) + stringId = RCT2_GLOBAL(rideEntry, uint16); + else + stringId = (typeId & 0xFF00) + 2; + + latDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; } else { uint8 *sceneryEntry = RCT2_GLOBAL(0x009ADA90 + (typeId & 0xFFFF) * 4, uint8*); stringId = RCT2_GLOBAL(sceneryEntry, uint16); + latDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; } - gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, STR_RESEARCH_RIDE_LABEL, 0); - } + gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, latDevelopmentFormat, 0); + } } #pragma endregion From 8f33388d37071a811f2e26583aeb3f2999f3a8e5 Mon Sep 17 00:00:00 2001 From: qcz Date: Tue, 19 Aug 2014 22:19:32 +0200 Subject: [PATCH 2/2] Typo in variable name --- src/window_research.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/window_research.c b/src/window_research.c index bce8c52442..c0138a751e 100644 --- a/src/window_research.c +++ b/src/window_research.c @@ -378,7 +378,7 @@ static void window_research_development_paint() y = w->y + window_research_development_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12; uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32); - int latDevelopmentFormat; + int lastDevelopmentFormat; if (typeId != 0xFFFFFFFF) { if (typeId >= 0x10000) { uint8 *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, uint8*); @@ -387,13 +387,13 @@ static void window_research_development_paint() else stringId = (typeId & 0xFF00) + 2; - latDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; + lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; } else { uint8 *sceneryEntry = RCT2_GLOBAL(0x009ADA90 + (typeId & 0xFFFF) * 4, uint8*); stringId = RCT2_GLOBAL(sceneryEntry, uint16); - latDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; + lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; } - gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, latDevelopmentFormat, 0); + gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, lastDevelopmentFormat, 0); } }