Remove some hardcoded numbers (#11004)

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

No files matched your search

+1 -1
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);
}
+2 -2
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;
}