diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index 1f4c384d27..802e7c5f59 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -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); } diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 1999ccbfff..55a9c07e6e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -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; }