mirror of https://github.com/OpenRCT2/OpenRCT2.git
Refactored code to use a constant for max circuits
This commit is contained in:
parent
b7e7915efa
commit
ac80ca7b46
|
@ -168,6 +168,7 @@ The following people are not part of the development team, but have been contrib
|
|||
* Geoff B. (geoff-B)
|
||||
* Ryan D. (rctdude2)
|
||||
* (zrowny)
|
||||
* Emre Aydin (aemreaydin)
|
||||
|
||||
## Toolchain
|
||||
* (Balletie) - macOS
|
||||
|
|
|
@ -3301,13 +3301,13 @@ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widge
|
|||
window_ride_load_dropdown(w, widget);
|
||||
break;
|
||||
case WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE:
|
||||
upper_bound = gCheatsUnlockOperatingLimits ? 255 : 20;
|
||||
upper_bound = gCheatsUnlockOperatingLimits ? 255 : MAX_CIRCUITS_PER_RIDE;
|
||||
lower_bound = 1;
|
||||
set_operating_setting(
|
||||
w->number, RideSetSetting::NumCircuits, std::clamp<int16_t>(ride->num_circuits + 1, lower_bound, upper_bound));
|
||||
break;
|
||||
case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE:
|
||||
upper_bound = gCheatsUnlockOperatingLimits ? 255 : 20;
|
||||
upper_bound = gCheatsUnlockOperatingLimits ? 255 : MAX_CIRCUITS_PER_RIDE;
|
||||
lower_bound = 1;
|
||||
set_operating_setting(
|
||||
w->number, RideSetSetting::NumCircuits, std::clamp<int16_t>(ride->num_circuits - 1, lower_bound, upper_bound));
|
||||
|
|
|
@ -252,7 +252,7 @@ bool RideSetSettingAction::ride_is_valid_lift_hill_speed(Ride* ride) const
|
|||
bool RideSetSettingAction::ride_is_valid_num_circuits() const
|
||||
{
|
||||
int32_t minNumCircuits = 1;
|
||||
int32_t maxNumCircuits = gCheatsUnlockOperatingLimits ? 255 : 20;
|
||||
int32_t maxNumCircuits = gCheatsUnlockOperatingLimits ? 255 : MAX_CIRCUITS_PER_RIDE;
|
||||
return _value >= minNumCircuits && _value <= maxNumCircuits;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ struct Vehicle;
|
|||
// Examples of vehicles here are the locomotive, tender and carriage of the Miniature Railway.
|
||||
#define MAX_VEHICLES_PER_RIDE_ENTRY 4
|
||||
constexpr const uint8_t MAX_VEHICLES_PER_RIDE = 31;
|
||||
constexpr const uint8_t MAX_CIRCUITS_PER_RIDE = 20;
|
||||
constexpr const uint8_t MAX_CARS_PER_TRAIN = 255;
|
||||
constexpr const uint8_t MAX_VEHICLE_COLOURS = std::max(MAX_CARS_PER_TRAIN, MAX_VEHICLES_PER_RIDE);
|
||||
#define NUM_COLOUR_SCHEMES 4
|
||||
|
|
Loading…
Reference in New Issue