From bf9efc7f8421f0526ebaf63ca413743d70dc0f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 5 Feb 2023 17:52:47 +0200 Subject: [PATCH] Rename some variables --- .../windows/EditorObjectSelection.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 4 +- src/openrct2/entity/Guest.cpp | 40 +++++++++---------- src/openrct2/ride/Vehicle.cpp | 2 +- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 9781f1ba32..6ab2c72847 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1505,8 +1505,8 @@ private: for (; ObjectEntryGetChunk(ObjectType::Ride, entry_index) == nullptr; entry_index++) ; - const auto* ride_entry = GetRideEntryByIndex(entry_index); - auto rideType = ride_entry->GetFirstNonNullRideType(); + const auto* rideEntry = GetRideEntryByIndex(entry_index); + auto rideType = rideEntry->GetFirstNonNullRideType(); auto intent = Intent(WindowClass::TrackDesignList); intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, rideType); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e2d28030d1..ab4a30f609 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1516,8 +1516,8 @@ static void WindowRideInitViewport(WindowBase* w) if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->NumTrains && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { auto vehId = ride->vehicles[viewSelectionIndex]; - const auto* ride_entry = ride->GetRideEntry(); - if (ride_entry != nullptr && ride_entry->TabCar != 0) + const auto* rideEntry = ride->GetRideEntry(); + if (rideEntry != nullptr && rideEntry->TabCar != 0) { Vehicle* vehicle = GetEntity(vehId); if (vehicle == nullptr) diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index d7b8d77ede..ff1e356030 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -3619,18 +3619,18 @@ void Guest::UpdateRideLeaveEntranceWaypoints(const Ride& ride) // TODO: Goto ride exit on failure. return; } - const auto* ride_entry = vehicle->GetRideEntry(); - const auto* vehicle_type = &ride_entry->Cars[vehicle->vehicle_type]; + const auto* rideEntry = vehicle->GetRideEntry(); + const auto* carEntry = &rideEntry->Cars[vehicle->vehicle_type]; - Var37 = (direction_entrance | GetWaypointedSeatLocation(ride, vehicle_type, direction_track) * 4) * 4; + Var37 = (direction_entrance | GetWaypointedSeatLocation(ride, carEntry, direction_track) * 4) * 4; const auto& rtd = ride.GetRideTypeDescriptor(); CoordsXY waypoint = rtd.GetGuestWaypointLocation(*vehicle, ride, CurrentRideStation); const auto waypointIndex = Var37 / 4; - Guard::Assert(vehicle_type->peep_loading_waypoints.size() >= static_cast(waypointIndex)); - waypoint.x += vehicle_type->peep_loading_waypoints[waypointIndex][0].x; - waypoint.y += vehicle_type->peep_loading_waypoints[waypointIndex][0].y; + Guard::Assert(carEntry->peep_loading_waypoints.size() >= static_cast(waypointIndex)); + waypoint.x += carEntry->peep_loading_waypoints[waypointIndex][0].x; + waypoint.y += carEntry->peep_loading_waypoints[waypointIndex][0].y; SetDestination(waypoint); RideSubState = PeepRideSubState::ApproachVehicleWaypoints; @@ -3648,16 +3648,16 @@ void Guest::UpdateRideAdvanceThroughEntrance() int16_t actionZ, xy_distance; - const auto* ride_entry = ride->GetRideEntry(); + const auto* rideEntry = ride->GetRideEntry(); if (auto loc = UpdateAction(xy_distance); loc.has_value()) { uint16_t distanceThreshold = 16; - if (ride_entry != nullptr) + if (rideEntry != nullptr) { - uint8_t vehicle = ride_entry->DefaultCar; - if (ride_entry->Cars[vehicle].flags & CAR_ENTRY_FLAG_MINI_GOLF - || ride_entry->Cars[vehicle].flags & (CAR_ENTRY_FLAG_CHAIRLIFT | CAR_ENTRY_FLAG_GO_KART)) + uint8_t vehicle = rideEntry->DefaultCar; + if (rideEntry->Cars[vehicle].flags & CAR_ENTRY_FLAG_MINI_GOLF + || rideEntry->Cars[vehicle].flags & (CAR_ENTRY_FLAG_CHAIRLIFT | CAR_ENTRY_FLAG_GO_KART)) { distanceThreshold = 28; } @@ -3709,13 +3709,13 @@ void Guest::UpdateRideAdvanceThroughEntrance() return; } - ride_entry = vehicle->GetRideEntry(); - if (ride_entry == nullptr) + rideEntry = vehicle->GetRideEntry(); + if (rideEntry == nullptr) { return; } - const auto* vehicle_type = &ride_entry->Cars[vehicle->vehicle_type]; + const auto* vehicle_type = &rideEntry->Cars[vehicle->vehicle_type]; if (vehicle_type->flags & CAR_ENTRY_FLAG_LOADING_WAYPOINTS) { @@ -3930,13 +3930,13 @@ void Guest::UpdateRideFreeVehicleCheck() if (vehicle == nullptr) return; - const auto* ride_entry = vehicle->GetRideEntry(); - if (ride_entry == nullptr) + const auto* rideEntry = vehicle->GetRideEntry(); + if (rideEntry == nullptr) { return; } - if (ride_entry->Cars[0].flags & CAR_ENTRY_FLAG_MINI_GOLF) + if (rideEntry->Cars[0].flags & CAR_ENTRY_FLAG_MINI_GOLF) { vehicle->mini_golf_flags &= ~MiniGolfFlag::Flag5; @@ -4424,13 +4424,13 @@ void Guest::UpdateRideApproachVehicleWaypoints() CoordsXY targetLoc = rtd.GetGuestWaypointLocation(*vehicle, *ride, CurrentRideStation); - const auto* ride_entry = vehicle->GetRideEntry(); - if (ride_entry == nullptr) + const auto* rideEntry = vehicle->GetRideEntry(); + if (rideEntry == nullptr) { return; } - const auto& vehicle_type = ride_entry->Cars[vehicle->vehicle_type]; + const auto& vehicle_type = rideEntry->Cars[vehicle->vehicle_type]; Guard::Assert(waypoint < 3); targetLoc.x += vehicle_type.peep_loading_waypoints[Var37 / 4][waypoint].x; targetLoc.y += vehicle_type.peep_loading_waypoints[Var37 / 4][waypoint].y; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index ac8cbab257..98a8a13cd4 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5982,7 +5982,7 @@ std::optional Vehicle::DodgemsCarWouldCollideAt(const CoordsXY& coords */ void Vehicle::UpdateTrackMotionUpStopCheck() const { - auto carEntry = Entry(); + const auto* carEntry = Entry(); if (carEntry == nullptr) { return;