From a5cbcb448ceded7e4c80f1e6a1193df62a33325f Mon Sep 17 00:00:00 2001 From: deurklink Date: Fri, 7 Sep 2018 13:08:26 +0200 Subject: [PATCH] Fix #7975: Clear inspection due flag when interval set to Never --- distribution/changelog.txt | 1 + src/openrct2/network/Network.cpp | 2 +- src/openrct2/ride/Ride.cpp | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b5513fe124..382077c178 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.2.1+ (in development) ------------------------------------------------------------------------ - Feature: [#7956, #7964] Add sprite font glyphs for Hungarian and some Czech letters. +- Fix: [#7975] Inspection flag not cleared for rides which are set to never be inspected (Original bug). - Improved: [#7930] Automatically create folders for custom content. - Removed: [#7929] Support for scenario text objects. diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index 0d4be94181..ac1315e281 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -28,7 +28,7 @@ // This string specifies which version of network stream current build uses. // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "0" +#define NETWORK_STREAM_VERSION "1" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static rct_peep* _pickup_peep = nullptr; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 316690bdd8..75a3415f84 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2386,8 +2386,12 @@ static void ride_inspection_update(Ride* ride) ride->last_inspection--; int32_t inspectionIntervalMinutes = RideInspectionInterval[ride->inspection_interval]; + // An inspection interval of 0 minutes means the ride is set to never be inspected. if (inspectionIntervalMinutes == 0) + { + ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; return; + } if (RideAvailableBreakdowns[ride->type] == 0) return; @@ -4108,6 +4112,11 @@ static money32 ride_set_setting(uint8_t rideIndex, uint8_t setting, uint8_t valu return MONEY32_UNDEFINED; } + if (value == RIDE_INSPECTION_NEVER) + { + ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION; + } + if (flags & GAME_COMMAND_FLAG_APPLY) { ride->inspection_interval = value;