Fix crash in paint_haunted_house_structure

[OpenRCT2/OpenRCT2#8662]
This commit is contained in:
Xkeeper 2019-02-05 10:58:43 -08:00
parent 6bdbe248fd
commit 2bb8813c41
No known key found for this signature in database
GPG Key ID: 397C04773ABE4045
1 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,11 @@ static void paint_haunted_house_structure(
Ride* ride = get_ride(rideIndex);
rct_ride_entry* rideEntry = get_ride_entry(ride->subtype);
if (rideEntry == nullptr)
{
log_error("Error drawing haunted house, rideEntry is NULL.");
return;
}
uint32_t baseImageId = rideEntry->vehicles[0].base_image_id;
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && ride->vehicles[0] != SPRITE_INDEX_NULL)