From d77d9e9a5806f33afe00d5abc7fb8d52c1a18b06 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 17 Mar 2015 10:45:33 +0100 Subject: [PATCH 1/3] Fix negative ride ages --- src/windows/ride.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/windows/ride.c b/src/windows/ride.c index ff84a7e466..b5e12c8237 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5878,6 +5878,9 @@ static void window_ride_customer_paint() // Age age = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16) - ride->build_date) / 8; + if (age < 0) { + age +=8192; + } stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? From aacef89973c22b9dca9e88f5938bf58777319e7d Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 17 Mar 2015 14:41:57 +0100 Subject: [PATCH 2/3] Reset build dates that are in the future --- src/windows/ride.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/windows/ride.c b/src/windows/ride.c index b5e12c8237..ca3cdda487 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5877,10 +5877,10 @@ static void window_ride_customer_paint() y += 2; // Age + //Reset build date to current if it's in the future + ride->build_date=min(ride->build_date,RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16)); + age = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16) - ride->build_date) / 8; - if (age < 0) { - age +=8192; - } stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? From ab5285cf1e4a6ed0bd0ff3df060a0fbbc0c53924 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 18 Mar 2015 16:20:12 +0100 Subject: [PATCH 3/3] Don't reset built dates that are in the future --- src/windows/ride.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/windows/ride.c b/src/windows/ride.c index ca3cdda487..d3abee3bdb 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -5877,10 +5877,8 @@ static void window_ride_customer_paint() y += 2; // Age - //Reset build date to current if it's in the future - ride->build_date=min(ride->build_date,RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16)); - - age = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16) - ride->build_date) / 8; + //If the ride has a build date that is in the future, show it as built this year. + age = max((RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16) - ride->build_date) / 8, 0); stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ?