Fix #2710. Chairlifts no longer crash at large y value stations.

This commit is contained in:
duncanspumpkin 2016-04-12 19:28:27 +01:00
parent 8e247c3b06
commit 08de41bdd5
1 changed files with 10 additions and 10 deletions

View File

@ -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)
) {