1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Remove some hardcoded numbers (#11004)

This commit is contained in:
Michael Steenbeek
2020-03-23 19:12:57 +01:00
committed by GitHub
parent 9860f1e99e
commit e66a6754f5
2 changed files with 3 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ public:
}
int32_t rideEntryIndex = ride_get_entry_index(_rideType, _subType);
if (rideEntryIndex >= 128)
if (rideEntryIndex >= MAX_RIDE_OBJECTS)
{
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_INVALID_RIDE_TYPE);
}

View File

@@ -3062,7 +3062,7 @@ static bool ride_does_vehicle_colour_exist(uint8_t ride_sub_type, vehicle_colour
int32_t ride_get_unused_preset_vehicle_colour(uint8_t ride_sub_type)
{
if (ride_sub_type >= 128)
if (ride_sub_type >= MAX_RIDE_OBJECTS)
{
return 0;
}
@@ -5554,7 +5554,7 @@ bool Ride::NameExists(const std::string_view& name, ride_id_t excludeRideId)
*/
int32_t ride_get_random_colour_preset_index(uint8_t ride_type)
{
if (ride_type >= 128)
if (ride_type >= std::size(RideColourPresets))
{
return 0;
}