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
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 6 additions and 1 deletions

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;