mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #16744 from Basssiiie/fix-unlimited-vehicles-defaults
Fix “Disable vehicle limits” cheat giving all new rides 32 trains with 12 cars
This commit is contained in:
commit
9b1c915f4d
|
@ -44,6 +44,7 @@
|
|||
- Fix: [#16007] Scenario Editor “Entry Price” appears to the right of the value field.
|
||||
- Fix: [#16008] Tile Inspector can select elements from last tile without reselecting it.
|
||||
- Fix: [#16024] Go-Karts with more than 32 vehicles do not colour themselves correctly.
|
||||
- Fix: [#16026] Newly created rides with “Disable vehicle limits” cheat always get 32 trains with 12 cars each.
|
||||
- Fix: [#16063] Object Selection preview for objects with glass is broken.
|
||||
- Fix: [#16075] Exporting track designs saves scenery in incorrect locations.
|
||||
- Fix: [#16087] The Looping Roller Coaster booster is now always drawn correctly.
|
||||
|
|
|
@ -154,10 +154,25 @@ GameActions::Result RideCreateAction::Execute() const
|
|||
ride->vehicle_change_timeout = 0;
|
||||
ride->num_stations = 0;
|
||||
ride->num_vehicles = 1;
|
||||
ride->proposed_num_vehicles = 32;
|
||||
if (gCheatsDisableTrainLengthLimit)
|
||||
{
|
||||
// Reduce amount of proposed trains to prevent 32 trains from always spawning when limits are disabled
|
||||
if (rideEntry->cars_per_flat_ride == NoFlatRideCars)
|
||||
{
|
||||
ride->proposed_num_vehicles = 12;
|
||||
}
|
||||
else
|
||||
{
|
||||
ride->proposed_num_vehicles = rideEntry->cars_per_flat_ride;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ride->proposed_num_vehicles = 32;
|
||||
}
|
||||
ride->max_trains = OpenRCT2::Limits::MaxTrainsPerRide;
|
||||
ride->num_cars_per_train = 1;
|
||||
ride->proposed_num_cars_per_train = 12;
|
||||
ride->proposed_num_cars_per_train = rideEntry->max_cars_in_train;
|
||||
ride->min_waiting_time = 10;
|
||||
ride->max_waiting_time = 60;
|
||||
ride->depart_flags = RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH | 3;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
// This string specifies which version of network stream current build uses.
|
||||
// It is used for making sure only compatible builds get connected, even within
|
||||
// single OpenRCT2 version.
|
||||
#define NETWORK_STREAM_VERSION "19"
|
||||
#define NETWORK_STREAM_VERSION "20"
|
||||
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
||||
|
||||
static Peep* _pickup_peep = nullptr;
|
||||
|
|
|
@ -670,7 +670,7 @@ void RideObject::ReadJsonVehicleInfo([[maybe_unused]] IReadObjectContext* contex
|
|||
|
||||
_legacyType.min_cars_in_train = Json::GetNumber<uint8_t>(properties["minCarsPerTrain"], 1);
|
||||
_legacyType.max_cars_in_train = Json::GetNumber<uint8_t>(properties["maxCarsPerTrain"], 1);
|
||||
_legacyType.cars_per_flat_ride = Json::GetNumber<uint8_t>(properties["carsPerFlatRide"], 255);
|
||||
_legacyType.cars_per_flat_ride = Json::GetNumber<uint8_t>(properties["carsPerFlatRide"], NoFlatRideCars);
|
||||
_legacyType.zero_cars = Json::GetNumber<uint8_t>(properties["numEmptyCars"]);
|
||||
|
||||
// Train formation from car indices
|
||||
|
|
|
@ -5032,7 +5032,7 @@ void Ride::UpdateMaxVehicles()
|
|||
uint8_t numCarsPerTrain, numVehicles;
|
||||
int32_t maxNumTrains;
|
||||
|
||||
if (rideEntry->cars_per_flat_ride == 0xFF)
|
||||
if (rideEntry->cars_per_flat_ride == NoFlatRideCars)
|
||||
{
|
||||
int32_t trainLength;
|
||||
num_cars_per_train = std::max(rideEntry->min_cars_in_train, num_cars_per_train);
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
// Set to 255 on all tracked ride entries
|
||||
static uint8_t constexpr NoFlatRideCars = 0xFF;
|
||||
|
||||
struct RideNaming
|
||||
{
|
||||
rct_string_id Name;
|
||||
|
|
Loading…
Reference in New Issue