From 6e70cd53d5bdfcab6f74185ae2f57452434ecac8 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 26 May 2021 16:08:52 +0300 Subject: [PATCH] Fix #14745: Mechanics ignoring rides with ids above 255 --- src/openrct2/ride/Ride.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 00e1e102ee..6043a5ddb4 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2078,8 +2078,12 @@ void Ride::Update() // Various things include news messages if (lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION)) - if (((gCurrentTicks >> 1) & 255) == static_cast(id)) + { + // Breakdown updates are distributed, only one ride can update the breakdown status per tick. + const auto updatingRideId = (gCurrentTicks / 2) % MAX_RIDES; + if (updatingRideId == id) ride_breakdown_status_update(this); + } ride_inspection_update(this); @@ -2326,6 +2330,7 @@ static void ride_breakdown_update(Ride* ride) { if (gCurrentTicks & 255) return; + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) return;