diff --git a/src/ride/cable_lift.c b/src/ride/cable_lift.c index ba9080958b..4d04a4970c 100644 --- a/src/ride/cable_lift.c +++ b/src/ride/cable_lift.c @@ -136,7 +136,7 @@ static void cable_lift_update_waiting_to_depart(rct_vehicle *vehicle) // Next check to see if the second part of the cable lift // is at the front of the passenger vehicle to simulate the // cable being attached underneath the train. - rct_vehicle* passengerVehicle = GET_VEHICLE(vehicle->var_C0); + rct_vehicle* passengerVehicle = GET_VEHICLE(vehicle->cable_lift_target); rct_vehicle* cableLiftSecondPart = GET_VEHICLE(vehicle->prev_vehicle_on_ride); sint16 dist_x = abs(passengerVehicle->x - cableLiftSecondPart->x); @@ -161,7 +161,7 @@ static void cable_lift_update_departing(rct_vehicle *vehicle) if (vehicle->sub_state < 16) return; - rct_vehicle* passengerVehicle = GET_VEHICLE(vehicle->var_C0); + rct_vehicle* passengerVehicle = GET_VEHICLE(vehicle->cable_lift_target); vehicle->status = VEHICLE_STATUS_TRAVELLING; passengerVehicle->status = VEHICLE_STATUS_TRAVELLING_CABLE_LIFT; } @@ -172,7 +172,7 @@ static void cable_lift_update_departing(rct_vehicle *vehicle) */ static void cable_lift_update_travelling(rct_vehicle *vehicle) { - rct_vehicle* passengerVehicle = GET_VEHICLE(vehicle->var_C0); + rct_vehicle* passengerVehicle = GET_VEHICLE(vehicle->cable_lift_target); vehicle->velocity = min(passengerVehicle->velocity, 439800); vehicle->acceleration = 0; diff --git a/src/ride/vehicle.c b/src/ride/vehicle.c index b174f8d370..466bf66370 100644 --- a/src/ride/vehicle.c +++ b/src/ride/vehicle.c @@ -1368,14 +1368,14 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){ ride->train_at_station[vehicle->current_station] = train_index; vehicle->sub_state = 1; - vehicle->var_C0 = 0; + vehicle->time_waiting = 0; vehicle_invalidate(vehicle); return; } else if (vehicle->sub_state == 1){ - if (vehicle->var_C0 != 0xFFFF) - vehicle->var_C0++; + if (vehicle->time_waiting != 0xFFFF) + vehicle->time_waiting++; vehicle->update_flags &= ~VEHICLE_UPDATE_FLAG_TRAIN_READY_DEPART; @@ -1395,7 +1395,7 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){ num_seats_on_train &= 0x7F; if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_TEST_MODE)){ - if (vehicle->var_C0 < 20){ + if (vehicle->time_waiting < 20){ train_ready_to_depart(vehicle, num_peeps_on_train, num_used_seats_on_train); return; } @@ -1409,13 +1409,13 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){ if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)){ if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH){ - if (ride->min_waiting_time * 32 > vehicle->var_C0){ + if (ride->min_waiting_time * 32 > vehicle->time_waiting){ train_ready_to_depart(vehicle, num_peeps_on_train, num_used_seats_on_train); return; } } if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH){ - if (ride->max_waiting_time * 32 < vehicle->var_C0){ + if (ride->max_waiting_time * 32 < vehicle->time_waiting){ vehicle->update_flags |= VEHICLE_UPDATE_FLAG_TRAIN_READY_DEPART; train_ready_to_depart(vehicle, num_peeps_on_train, num_used_seats_on_train); return; @@ -3070,7 +3070,7 @@ static void vehicle_update_waiting_for_cable_lift(rct_vehicle *vehicle) return; cableLift->status = VEHICLE_STATUS_WAITING_TO_DEPART; - cableLift->var_C0 = vehicle->sprite_index; + cableLift->cable_lift_target = vehicle->sprite_index; } /** diff --git a/src/ride/vehicle.h b/src/ride/vehicle.h index 51386b6e08..ac82101f00 100644 --- a/src/ride/vehicle.h +++ b/src/ride/vehicle.h @@ -165,7 +165,11 @@ typedef struct { uint8 sound2_id; // 0xBD uint8 sound2_volume; // 0xBE sint8 var_BF; - uint16 var_C0; + union { + uint16 var_C0; + uint16 time_waiting; // 0xC0 + uint16 cable_lift_target; // 0xC0 + }; uint8 speed; // 0xC2 uint8 powered_acceleration; // 0xC3 uint8 var_C4;