mirror of https://github.com/OpenRCT2/OpenRCT2.git
Rename some variables
This commit is contained in:
parent
a2a06d6dde
commit
bf9efc7f84
|
@ -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);
|
||||
|
|
|
@ -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<Vehicle>(vehId);
|
||||
if (vehicle == nullptr)
|
||||
|
|
|
@ -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<size_t>(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<size_t>(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;
|
||||
|
|
|
@ -5982,7 +5982,7 @@ std::optional<EntityId> Vehicle::DodgemsCarWouldCollideAt(const CoordsXY& coords
|
|||
*/
|
||||
void Vehicle::UpdateTrackMotionUpStopCheck() const
|
||||
{
|
||||
auto carEntry = Entry();
|
||||
const auto* carEntry = Entry();
|
||||
if (carEntry == nullptr)
|
||||
{
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue