From 27ec97d3c5406d513488ca81297c272739a552ce Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Mon, 11 Jan 2016 18:35:36 +0000 Subject: [PATCH] Fix #2694. Multi tile block breaks (i.e. cable lifts) now correctly unstop. Issue was caused by looking at the wrong tile to unstop --- src/ride/vehicle.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index a18253b8fa..35cc18668e 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -3130,7 +3130,7 @@ static void vehicle_update_travelling_cable_lift(rct_vehicle* vehicle) { } int flags = vehicle_update_track_motion(vehicle, NULL); - if (flags & (1 << 11)) { + if (flags & VEHICLE_UPDATE_MOTION_TRACK_FLAG_11) { vehicle->status = VEHICLE_STATUS_TRAVELLING; vehicle_invalidate_window(vehicle); vehicle->sub_state = 1; @@ -3141,7 +3141,7 @@ static void vehicle_update_travelling_cable_lift(rct_vehicle* vehicle) { if (vehicle->sub_state == 2) return; - if (flags & (1 << 3) && vehicle->current_station == RCT2_GLOBAL(0x00F64E1C, uint8)) + if (flags & VEHICLE_UPDATE_MOTION_TRACK_FLAG_3 && vehicle->current_station == RCT2_GLOBAL(0x00F64E1C, uint8)) return; vehicle->sub_state = 2; @@ -5427,6 +5427,10 @@ static void vehicle_update_block_breaks_open_previous_section(rct_vehicle *vehic mapElement = trackBeginEnd.begin_element; } while (!track_element_is_block_start(trackBeginEnd.begin_element)); + // Get the start of the track block instead of the end + x = trackBeginEnd.begin_x; + y = trackBeginEnd.begin_y; + z = trackBeginEnd.begin_z; mapElement = map_get_track_element_at(x, y, z >> 3); if (mapElement == NULL) { return;