From 857db2925ca015bc62a9366dd4bdeb481a61295a Mon Sep 17 00:00:00 2001 From: hdpoliveira Date: Fri, 10 Apr 2020 00:39:38 -0300 Subject: [PATCH] Part of #9473: Convert cable_lift_update to Vehicle private method CableLiftUpdate --- src/openrct2/ride/CableLift.cpp | 14 +++++++------- src/openrct2/ride/CableLift.h | 1 - src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/Vehicle.h | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index dadf64f2e8..bb2bab30da 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -88,27 +88,27 @@ Vehicle* cable_lift_segment_create( return current; } -void cable_lift_update(Vehicle* vehicle) +void Vehicle::CableLiftUpdate() { - switch (vehicle->status) + switch (status) { case VEHICLE_STATUS_MOVING_TO_END_OF_STATION: - cable_lift_update_moving_to_end_of_station(vehicle); + cable_lift_update_moving_to_end_of_station(this); break; case VEHICLE_STATUS_WAITING_FOR_PASSENGERS: // Stays in this state until a train puts it into next state break; case VEHICLE_STATUS_WAITING_TO_DEPART: - cable_lift_update_waiting_to_depart(vehicle); + cable_lift_update_waiting_to_depart(this); break; case VEHICLE_STATUS_DEPARTING: - cable_lift_update_departing(vehicle); + cable_lift_update_departing(this); break; case VEHICLE_STATUS_TRAVELLING: - cable_lift_update_travelling(vehicle); + cable_lift_update_travelling(this); break; case VEHICLE_STATUS_ARRIVING: - cable_lift_update_arriving(vehicle); + cable_lift_update_arriving(this); break; default: break; diff --git a/src/openrct2/ride/CableLift.h b/src/openrct2/ride/CableLift.h index 447ccf4d8a..bd41aa8a10 100644 --- a/src/openrct2/ride/CableLift.h +++ b/src/openrct2/ride/CableLift.h @@ -15,7 +15,6 @@ Vehicle* cable_lift_segment_create( Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head); -void cable_lift_update(Vehicle* vehicle); int32_t cable_lift_update_track_motion(Vehicle* cableLift); #endif diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 9f92605c31..15a9d97c63 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1966,7 +1966,7 @@ void Vehicle::Update() // The cable lift uses the ride type of NULL if (ride_subtype == RIDE_TYPE_NULL) { - cable_lift_update(this); + CableLiftUpdate(); return; } diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 1fb7aaad60..274be46ef7 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -307,6 +307,7 @@ private: bool SoundCanPlay() const; uint16_t GetSoundPriority() const; rct_vehicle_sound_params CreateSoundParam(uint16_t priority) const; + void CableLiftUpdate(); }; struct train_ref