Merge pull request #27109 from Gymnasiast/fix/wrong-number-of-cars-per-train-rct1

Fix: Some rides in RCT1 saves have a wrong number of cars per train
This commit is contained in:
Michael Steenbeek authored and GitHub committed 2026-09-13 01:32:20 +02:00
commit 831ea32857
5 files changed
+31 -3

No files matched your search

+2
View File
@@ -5,6 +5,7 @@
- Change: [#27100] Negative G-forces no longer turn red in the stats window and graph when below -2.50.
- Fix: [#1514] Wrong capitalisation for strings in the Guest List window.
- Fix: [#21320] RCT1 allows more cars per train on some rides than OpenRCT2.
- Fix: [#21576] RCT1 Wooden wild mouse track designs with 2-car trains are not imported correctly.
- Fix: [#24457] Yellow is always rendered as third remap in Ride window.
- Fix: [#26754] Switching window tabs by touch could crash the game on some Linux builds.
- Fix: [#27052] Unnamed rides in RCT2 base and Wacky Worlds scenarios have hardcoded English names.
@@ -12,6 +13,7 @@
- Fix: [#27084] [Plugin] `PermissionType` for `drag_path_area` is missing.
- Fix: [#27087] The ‘Update available’ widget is offset incorrectly.
- Fix: [#27093] Pause and fast forward buttons are shown in multiplayer.
- Fix: [#27109] Some rides in RCT1 saves have a wrong number of cars per train.
0.5.5 (2026-09-06)
------------------------------------------------------------------------
+3 -2
View File
@@ -935,10 +935,11 @@ namespace OpenRCT2::RCT1
}
dst->numTrains = src->numTrains;
dst->numCarsPerTrain = src->numCarsPerTrain + rideEntry->zero_cars;
const auto additionalZeroCars = getAdditionalZeroCars(src->vehicleType);
dst->numCarsPerTrain = src->numCarsPerTrain + additionalZeroCars;
dst->proposedNumTrains = src->numTrains;
dst->maxTrains = src->maxTrains;
dst->proposedNumCarsPerTrain = src->numCarsPerTrain + rideEntry->zero_cars;
dst->proposedNumCarsPerTrain = src->numCarsPerTrain + additionalZeroCars;
auto split = splitCombinedHelicesAndSpecialElements(src->specialTrackElements);
dst->numHelices = split.first;
dst->specialTrackElements = split.second;
+2 -1
View File
@@ -245,7 +245,8 @@ namespace OpenRCT2::RCT1
td->appearance.stationObjectIdentifier = GetStationIdentifierFromStyle(RCT12_STATION_STYLE_PLAIN);
td->operation.departFlags = td4Base.DepartFlags;
td->trackAndVehicle.numberOfTrains = td4Base.NumberOfTrains;
td->trackAndVehicle.numberOfCarsPerTrain = td4Base.NumberOfCarsPerTrain;
td->trackAndVehicle.numberOfCarsPerTrain = td4Base.NumberOfCarsPerTrain
+ getAdditionalZeroCars(td4Base.VehicleType);
td->operation.minWaitingTime = td4Base.MinWaitingTime;
td->operation.maxWaitingTime = td4Base.MaxWaitingTime;
td->operation.operationSetting = std::min(
+19
View File
@@ -1514,4 +1514,23 @@ namespace OpenRCT2::RCT1
return false;
}
}
uint8_t getAdditionalZeroCars(const VehicleType vehicleType)
{
switch (vehicleType)
{
case VehicleType::woodenMineCars:
case VehicleType::woodenMouseCars:
case VehicleType::steelMouseCars:
case VehicleType::sportscars:
case VehicleType::racingCars:
case VehicleType::trucks:
case VehicleType::vintageCars:
case VehicleType::catCars:
case VehicleType::helicopterCars:
return 2;
default:
return 0;
}
}
} // namespace OpenRCT2::RCT1
+5
View File
@@ -57,4 +57,9 @@ namespace OpenRCT2::RCT1
const std::vector<const char*> GetSceneryObjects(uint8_t sceneryType);
bool VehicleTypeIsReversed(VehicleType vehicleType);
/**
* For some vehicles, OpenRCT2 has added zero cars in order to make them work with scenery doors.
* When setting the number of cars per train, this has to be taken into account.
*/
uint8_t getAdditionalZeroCars(VehicleType vehicleType);
} // namespace OpenRCT2::RCT1