don't paint track of an invalid ride, should help reduce crashes

This commit is contained in:
IntelOrca 2016-01-07 23:16:17 +00:00
parent 43a5cc92cc
commit 17c01a36a7
1 changed files with 4 additions and 0 deletions

View File

@ -1531,6 +1531,10 @@ void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *ma
rideIndex = mapElement->properties.track.ride_index;
ride = GET_RIDE(rideIndex);
if (ride->type == RIDE_TYPE_NULL) {
log_error("Attempted to paint invalid ride: %d", rideIndex);
return;
}
// HACK Set entrance style to plain if none to stop glitch until entrance track piece is implemented
bool isEntranceStyleNone = false;