From 1b61b4b10404e6e1d63a611ed3459f273b9d6dd3 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 5 Dec 2020 11:05:55 -0700 Subject: [PATCH] Fix #13489: Mechanics continue heading to inspect broken down rides (#13490) * Fix #13489: Mechanics continue heading to inspect broken down rides --- contributors.md | 1 + distribution/changelog.txt | 1 + src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/ride/Ride.cpp | 8 ++++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/contributors.md b/contributors.md index eeba7fd4e1..d3c2a9abff 100644 --- a/contributors.md +++ b/contributors.md @@ -162,6 +162,7 @@ The following people are not part of the development team, but have been contrib * Roger Seekell (rpstester) * Ben Johnston (gsckoco) * (evilclownattack) +* Adam Bloom (adam-bloom) ## Toolchain * (Balletie) - macOS diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 31bcd9d57f..e9b438d604 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -12,6 +12,7 @@ - Fix: [#13454] Plug-ins do not load on Windows if the user directory contains non-ASCII characters. - Fix: [#13469] Exception thrown from plugin in context.subscribe. - Fix: [#13477] Plug-in widget tooltips do not work. +- Fix: [#13489] Mechanics continue heading to inspect broken down rides. - Improved: [#12917] Changed peep movement so that they stay more spread out over the full width of single tile paths. - Removed: [#13423] Built-in explode guests cheat (replaced by plug-in). diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index e27d49760e..c8adb289ee 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -34,7 +34,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 "6" +#define NETWORK_STREAM_VERSION "7" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION static Peep* _pickup_peep = nullptr; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 632f74383f..4b37886a04 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2627,6 +2627,7 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus) case RIDE_MECHANIC_STATUS_HEADING: { auto mechanic = ride_get_mechanic(ride); + bool rideNeedsRepair = (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN)); if (mechanic == nullptr || (mechanic->State != PeepState::HeadingToInspection && mechanic->State != PeepState::Answering) || mechanic->CurrentRide != ride->id) @@ -2635,6 +2636,13 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus) ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAINTENANCE; ride_mechanic_status_update(ride, RIDE_MECHANIC_STATUS_CALLING); } + // if the ride is broken down, but a mechanic was heading for an inspection, update orders to fix + else if (rideNeedsRepair && mechanic->State == PeepState::HeadingToInspection) + { + // updates orders for mechanic already heading to inspect ride + // forInspection == false means start repair (goes to PeepState::Answering) + ride_call_mechanic(ride, mechanic, false); + } break; } case RIDE_MECHANIC_STATUS_FIXING: