diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index ba48e57eb7..90188e8542 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -6777,18 +6777,18 @@ loc_6DB41D: } if (vehicle->var_CD != 0 && vehicle->var_CD < 5) { - regs.ax >>= 5; - regs.cx >>= 5; - regs.ah = regs.cl; + rct_xy8 curLocation = { + .x = regs.ax >> 5, + .y = regs.cx >> 5 + }; + regs.dx >>= 3; - if (regs.ax != ride->chairlift_bullwheel_location[1].xy || regs.dl != ride->chairlift_bullwheel_z[1]) { - if (regs.ax == ride->chairlift_bullwheel_location[0].xy && regs.dl == ride->chairlift_bullwheel_z[0]) { - vehicle->var_CD = 4; - } - } - else { + if (curLocation.xy == ride->chairlift_bullwheel_location[1].xy && regs.dl == ride->chairlift_bullwheel_z[1]) { vehicle->var_CD = 3; } + else if (curLocation.xy == ride->chairlift_bullwheel_location[0].xy && regs.dl == ride->chairlift_bullwheel_z[0]) { + vehicle->var_CD = 4; + } } // loc_6DB500 @@ -7127,7 +7127,7 @@ bool vehicle_update_track_motion_backwards_get_new_track(rct_vehicle *vehicle, u if (vehicle->var_CD != 0 && vehicle->var_CD < 5 ) { - sint16 xy = (x >> 5) | ((y >> 5) << 8); + uint16 xy = (x >> 5) | ((y >> 5) << 8); if (ride->chairlift_bullwheel_location[1].xy == xy && ride->chairlift_bullwheel_z[1] == (z >> 3) ) {