1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix #13489: Mechanics continue heading to inspect broken down rides (#13490)

* Fix #13489: Mechanics continue heading to inspect broken down rides
This commit is contained in:
Adam
2020-12-05 11:05:55 -07:00
committed by GitHub
parent a71a0ccd0c
commit 1b61b4b104
4 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

@@ -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).

View File

@@ -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;

View File

@@ -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: