From c1a413c298771e8769cb3021961bc205806b2595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 19 Mar 2016 00:47:06 +0100 Subject: [PATCH] Fix crash when opening canoes --- src/ride/vehicle.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index ba48e57eb7..7ee5d077eb 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -6597,6 +6597,9 @@ void sub_6DBF3E(rct_vehicle *vehicle) trackType, 0 ); + if (mapElement == NULL) { + return; + } if (RCT2_GLOBAL(0x00F64E1C, uint32) == 0xFFFFFFFF) { RCT2_GLOBAL(0x00F64E1C, uint32) = (mapElement->properties.track.sequence >> 4) & 7; } @@ -6663,6 +6666,9 @@ bool vehicle_update_track_motion_forwards_get_new_track(rct_vehicle *vehicle, ui trackType, 0 ); + if (mapElement == NULL) { + return false; + } if (trackType == TRACK_ELEM_CABLE_LIFT_HILL && vehicle == RCT2_GLOBAL(0x00F64E04, rct_vehicle*)) { RCT2_GLOBAL(0x00F64E18, uint32) |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_11; }