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++)
|
for (; ObjectEntryGetChunk(ObjectType::Ride, entry_index) == nullptr; entry_index++)
|
||||||
;
|
;
|
||||||
|
|
||||||
const auto* ride_entry = GetRideEntryByIndex(entry_index);
|
const auto* rideEntry = GetRideEntryByIndex(entry_index);
|
||||||
auto rideType = ride_entry->GetFirstNonNullRideType();
|
auto rideType = rideEntry->GetFirstNonNullRideType();
|
||||||
|
|
||||||
auto intent = Intent(WindowClass::TrackDesignList);
|
auto intent = Intent(WindowClass::TrackDesignList);
|
||||||
intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, rideType);
|
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)
|
if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->NumTrains && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)
|
||||||
{
|
{
|
||||||
auto vehId = ride->vehicles[viewSelectionIndex];
|
auto vehId = ride->vehicles[viewSelectionIndex];
|
||||||
const auto* ride_entry = ride->GetRideEntry();
|
const auto* rideEntry = ride->GetRideEntry();
|
||||||
if (ride_entry != nullptr && ride_entry->TabCar != 0)
|
if (rideEntry != nullptr && rideEntry->TabCar != 0)
|
||||||
{
|
{
|
||||||
Vehicle* vehicle = GetEntity<Vehicle>(vehId);
|
Vehicle* vehicle = GetEntity<Vehicle>(vehId);
|
||||||
if (vehicle == nullptr)
|
if (vehicle == nullptr)
|
||||||
|
|
|
@ -3619,18 +3619,18 @@ void Guest::UpdateRideLeaveEntranceWaypoints(const Ride& ride)
|
||||||
// TODO: Goto ride exit on failure.
|
// TODO: Goto ride exit on failure.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto* ride_entry = vehicle->GetRideEntry();
|
const auto* rideEntry = vehicle->GetRideEntry();
|
||||||
const auto* vehicle_type = &ride_entry->Cars[vehicle->vehicle_type];
|
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();
|
const auto& rtd = ride.GetRideTypeDescriptor();
|
||||||
CoordsXY waypoint = rtd.GetGuestWaypointLocation(*vehicle, ride, CurrentRideStation);
|
CoordsXY waypoint = rtd.GetGuestWaypointLocation(*vehicle, ride, CurrentRideStation);
|
||||||
|
|
||||||
const auto waypointIndex = Var37 / 4;
|
const auto waypointIndex = Var37 / 4;
|
||||||
Guard::Assert(vehicle_type->peep_loading_waypoints.size() >= static_cast<size_t>(waypointIndex));
|
Guard::Assert(carEntry->peep_loading_waypoints.size() >= static_cast<size_t>(waypointIndex));
|
||||||
waypoint.x += vehicle_type->peep_loading_waypoints[waypointIndex][0].x;
|
waypoint.x += carEntry->peep_loading_waypoints[waypointIndex][0].x;
|
||||||
waypoint.y += vehicle_type->peep_loading_waypoints[waypointIndex][0].y;
|
waypoint.y += carEntry->peep_loading_waypoints[waypointIndex][0].y;
|
||||||
|
|
||||||
SetDestination(waypoint);
|
SetDestination(waypoint);
|
||||||
RideSubState = PeepRideSubState::ApproachVehicleWaypoints;
|
RideSubState = PeepRideSubState::ApproachVehicleWaypoints;
|
||||||
|
@ -3648,16 +3648,16 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
||||||
|
|
||||||
int16_t actionZ, xy_distance;
|
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())
|
if (auto loc = UpdateAction(xy_distance); loc.has_value())
|
||||||
{
|
{
|
||||||
uint16_t distanceThreshold = 16;
|
uint16_t distanceThreshold = 16;
|
||||||
if (ride_entry != nullptr)
|
if (rideEntry != nullptr)
|
||||||
{
|
{
|
||||||
uint8_t vehicle = ride_entry->DefaultCar;
|
uint8_t vehicle = rideEntry->DefaultCar;
|
||||||
if (ride_entry->Cars[vehicle].flags & CAR_ENTRY_FLAG_MINI_GOLF
|
if (rideEntry->Cars[vehicle].flags & CAR_ENTRY_FLAG_MINI_GOLF
|
||||||
|| ride_entry->Cars[vehicle].flags & (CAR_ENTRY_FLAG_CHAIRLIFT | CAR_ENTRY_FLAG_GO_KART))
|
|| rideEntry->Cars[vehicle].flags & (CAR_ENTRY_FLAG_CHAIRLIFT | CAR_ENTRY_FLAG_GO_KART))
|
||||||
{
|
{
|
||||||
distanceThreshold = 28;
|
distanceThreshold = 28;
|
||||||
}
|
}
|
||||||
|
@ -3709,13 +3709,13 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ride_entry = vehicle->GetRideEntry();
|
rideEntry = vehicle->GetRideEntry();
|
||||||
if (ride_entry == nullptr)
|
if (rideEntry == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
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)
|
if (vehicle_type->flags & CAR_ENTRY_FLAG_LOADING_WAYPOINTS)
|
||||||
{
|
{
|
||||||
|
@ -3930,13 +3930,13 @@ void Guest::UpdateRideFreeVehicleCheck()
|
||||||
if (vehicle == nullptr)
|
if (vehicle == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto* ride_entry = vehicle->GetRideEntry();
|
const auto* rideEntry = vehicle->GetRideEntry();
|
||||||
if (ride_entry == nullptr)
|
if (rideEntry == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
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;
|
vehicle->mini_golf_flags &= ~MiniGolfFlag::Flag5;
|
||||||
|
|
||||||
|
@ -4424,13 +4424,13 @@ void Guest::UpdateRideApproachVehicleWaypoints()
|
||||||
|
|
||||||
CoordsXY targetLoc = rtd.GetGuestWaypointLocation(*vehicle, *ride, CurrentRideStation);
|
CoordsXY targetLoc = rtd.GetGuestWaypointLocation(*vehicle, *ride, CurrentRideStation);
|
||||||
|
|
||||||
const auto* ride_entry = vehicle->GetRideEntry();
|
const auto* rideEntry = vehicle->GetRideEntry();
|
||||||
if (ride_entry == nullptr)
|
if (rideEntry == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& vehicle_type = ride_entry->Cars[vehicle->vehicle_type];
|
const auto& vehicle_type = rideEntry->Cars[vehicle->vehicle_type];
|
||||||
Guard::Assert(waypoint < 3);
|
Guard::Assert(waypoint < 3);
|
||||||
targetLoc.x += vehicle_type.peep_loading_waypoints[Var37 / 4][waypoint].x;
|
targetLoc.x += vehicle_type.peep_loading_waypoints[Var37 / 4][waypoint].x;
|
||||||
targetLoc.y += vehicle_type.peep_loading_waypoints[Var37 / 4][waypoint].y;
|
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
|
void Vehicle::UpdateTrackMotionUpStopCheck() const
|
||||||
{
|
{
|
||||||
auto carEntry = Entry();
|
const auto* carEntry = Entry();
|
||||||
if (carEntry == nullptr)
|
if (carEntry == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue