From 6414d44306efbb87f05a3d308819b8083d3925fa Mon Sep 17 00:00:00 2001 From: zsilencer Date: Fri, 22 Aug 2014 14:05:41 -0600 Subject: [PATCH 1/2] window_research_development_paint() crash fix When the Currently in development Type: is "Ride" the game will crash, looks like the wrong value is ANDed. --- src/window_research.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window_research.c b/src/window_research.c index c0138a751e..604d2c63c3 100644 --- a/src/window_research.c +++ b/src/window_research.c @@ -346,7 +346,7 @@ static void window_research_development_paint() if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000) stringId = RCT2_GLOBAL(rideEntry, uint16); else - stringId = (typeId & 0xFF00) + 2; + stringId = (typeId & 0xFF) + 2; } else { uint8 *sceneryEntry = RCT2_GLOBAL(0x009ADA90 + (typeId & 0xFFFF) * 4, uint8*); stringId = RCT2_GLOBAL(sceneryEntry, uint16); From 0992a6adcd387d6ea629916f4effe8ee1a459425 Mon Sep 17 00:00:00 2001 From: zsilencer Date: Fri, 22 Aug 2014 15:37:18 -0600 Subject: [PATCH 2/2] window_research_development_paint() ride names fix stringId from typeId was not working right, this fixes it and gives correct research ride names --- src/window_research.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window_research.c b/src/window_research.c index 604d2c63c3..8082f9a88c 100644 --- a/src/window_research.c +++ b/src/window_research.c @@ -346,7 +346,7 @@ static void window_research_development_paint() if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000) stringId = RCT2_GLOBAL(rideEntry, uint16); else - stringId = (typeId & 0xFF) + 2; + stringId = ((typeId >> 8) & 0xFF) + 2; } else { uint8 *sceneryEntry = RCT2_GLOBAL(0x009ADA90 + (typeId & 0xFFFF) * 4, uint8*); stringId = RCT2_GLOBAL(sceneryEntry, uint16); @@ -385,7 +385,7 @@ static void window_research_development_paint() if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000) stringId = RCT2_GLOBAL(rideEntry, uint16); else - stringId = (typeId & 0xFF00) + 2; + stringId = ((typeId >> 8) & 0xFF) + 2; lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; } else {