mirror of https://github.com/OpenRCT2/OpenRCT2.git
Part of #21421: Refactor VEHICLE_SEAT_NUM_MASK
This commit is contained in:
parent
2c4c2da319
commit
b60483f25d
|
@ -2581,7 +2581,7 @@ bool Guest::FindVehicleToEnter(const Ride& ride, std::vector<uint8_t>& car_array
|
|||
car_array.push_back(i);
|
||||
return true;
|
||||
}
|
||||
num_seats &= VEHICLE_SEAT_NUM_MASK;
|
||||
num_seats &= kVehicleSeatNumMask;
|
||||
}
|
||||
if (num_seats == vehicle->next_free_seat)
|
||||
continue;
|
||||
|
|
|
@ -517,7 +517,7 @@ enum
|
|||
};
|
||||
|
||||
constexpr uint8_t kVehicleSeatPairFlag{ 0x80 };
|
||||
#define VEHICLE_SEAT_NUM_MASK 0x7F
|
||||
constexpr uint8_t kVehicleSeatNumMask{ 0x7F };
|
||||
|
||||
Vehicle* TryGetVehicle(EntityId spriteIndex);
|
||||
void VehicleUpdateAll();
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace OpenRCT2::Scripting
|
|||
uint8_t ScVehicle::numSeats_get() const
|
||||
{
|
||||
auto vehicle = GetVehicle();
|
||||
return vehicle != nullptr ? vehicle->num_seats & VEHICLE_SEAT_NUM_MASK : 0;
|
||||
return vehicle != nullptr ? vehicle->num_seats & kVehicleSeatNumMask : 0;
|
||||
}
|
||||
void ScVehicle::numSeats_set(uint8_t value)
|
||||
{
|
||||
|
@ -163,8 +163,8 @@ namespace OpenRCT2::Scripting
|
|||
auto vehicle = GetVehicle();
|
||||
if (vehicle != nullptr)
|
||||
{
|
||||
vehicle->num_seats &= ~VEHICLE_SEAT_NUM_MASK;
|
||||
vehicle->num_seats |= value & VEHICLE_SEAT_NUM_MASK;
|
||||
vehicle->num_seats &= ~kVehicleSeatNumMask;
|
||||
vehicle->num_seats |= value & kVehicleSeatNumMask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue