Fix #11084: null broken vehicle (#11090)

This commit is contained in:
Michał Janiszewski 2020-03-28 11:21:24 +01:00 committed by GitHub
parent fa1ddbd9e3
commit 24edada2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -7105,7 +7105,7 @@ Vehicle* ride_get_broken_vehicle(Ride* ride)
}
Vehicle* vehicle = GET_VEHICLE(vehicleIndex);
for (uint8_t i = 0; i < ride->broken_car; i++)
for (uint8_t i = 0; vehicle && i < ride->broken_car; i++)
{
vehicle = GET_VEHICLE(vehicle->next_vehicle_on_train);
}