From e66a6754f51148c9ec578b48a3cdeb309b3878bd Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 23 Mar 2020 19:12:57 +0100 Subject: [PATCH] Remove some hardcoded numbers (#11004) --- src/openrct2/actions/RideCreateAction.hpp | 2 +- src/openrct2/ride/Ride.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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; }