1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Part of #9473: Create Vehicle::IsUsedInPairs

Converted from vehicle_is_used_in_pairs
This commit is contained in:
hdpoliveira
2020-04-19 02:11:58 -03:00
parent 21beb2368e
commit e8c95e6e3a
3 changed files with 6 additions and 6 deletions

View File

@@ -2596,7 +2596,7 @@ bool Guest::FindVehicleToEnter(Ride* ride, std::vector<uint8_t>& car_array)
vehicle = GET_VEHICLE(vehicle_id);
uint8_t num_seats = vehicle->num_seats;
if (vehicle_is_used_in_pairs(vehicle))
if (vehicle->IsUsedInPairs())
{
if (vehicle->next_free_seat & 1)
{
@@ -3992,7 +3992,7 @@ void Guest::UpdateRideFreeVehicleCheck()
}
}
if (!vehicle_is_used_in_pairs(vehicle))
if (!vehicle->IsUsedInPairs())
{
UpdateRideFreeVehicleEnterRide(ride);
return;
@@ -4064,7 +4064,7 @@ void Guest::UpdateRideEnterVehicle()
return;
}
if (vehicle_is_used_in_pairs(vehicle))
if (vehicle->IsUsedInPairs())
{
auto* seatedPeep = GET_PEEP(vehicle->peep[current_seat ^ 1]);
if (seatedPeep != nullptr)

View File

@@ -6224,9 +6224,9 @@ Vehicle* Vehicle::TrainTail() const
return const_cast<Vehicle*>(vehicle);
}
int32_t vehicle_is_used_in_pairs(const Vehicle* vehicle)
int32_t Vehicle::IsUsedInPairs() const
{
return vehicle->num_seats & VEHICLE_SEAT_PAIR_FLAG;
return num_seats & VEHICLE_SEAT_PAIR_FLAG;
}
/**

View File

@@ -307,6 +307,7 @@ struct Vehicle : SpriteBase
void UpdateSoundParams(std::vector<rct_vehicle_sound_params>& vehicleSoundParamsList) const;
bool DodgemsCarWouldCollideAt(const CoordsXY& coords, uint16_t* spriteId) const;
int32_t UpdateTrackMotion(int32_t* outStation);
int32_t IsUsedInPairs() const;
rct_ride_entry_vehicle* Entry() const;
Vehicle* TrainHead() const;
Vehicle* TrainTail() const;
@@ -562,7 +563,6 @@ void vehicle_update_all();
void vehicle_sounds_update();
GForces vehicle_get_g_forces(const Vehicle* vehicle);
void vehicle_set_map_toolbar(const Vehicle* vehicle);
int32_t vehicle_is_used_in_pairs(const Vehicle* vehicle);
const rct_vehicle_info* vehicle_get_move_info(int32_t trackSubposition, int32_t typeAndDirection, int32_t offset);
uint16_t vehicle_get_move_info_size(int32_t trackSubposition, int32_t typeAndDirection);