mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix segfaults on rides without vehicles
This commit is contained in:
parent
67d99a34f2
commit
14f6da31c9
|
@ -481,11 +481,11 @@ static int cc_rides(const utf8 **argv, int argc)
|
||||||
rct_ride *ride = get_ride(ride_index);
|
rct_ride *ride = get_ride(ride_index);
|
||||||
for (int i = 0; i < ride->num_vehicles; i++) {
|
for (int i = 0; i < ride->num_vehicles; i++) {
|
||||||
uint16 vehicle_index = ride->vehicles[i];
|
uint16 vehicle_index = ride->vehicles[i];
|
||||||
do {
|
while (vehicle_index != SPRITE_INDEX_NULL) {
|
||||||
rct_vehicle *vehicle=GET_VEHICLE(vehicle_index);
|
rct_vehicle *vehicle=GET_VEHICLE(vehicle_index);
|
||||||
vehicle->friction=friction;
|
vehicle->friction=friction;
|
||||||
vehicle_index=vehicle->next_vehicle_on_train;
|
vehicle_index=vehicle->next_vehicle_on_train;
|
||||||
}while (vehicle_index != SPRITE_INDEX_NULL);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue