1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00

Fix #14745: Mechanics ignoring rides with ids above 255

This commit is contained in:
Matt
2021-05-26 16:08:52 +03:00
parent 6e609961e2
commit 6e70cd53d5

View File

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