mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Fix #25207: No switch to block sectioned mode after building one on the LIM LRC
This commit is contained in:
committed by
GitHub
parent
41dd05ea43
commit
744c1fd5a3
@@ -19,6 +19,7 @@
|
||||
- Fix: [#25163] Some of the Junior Roller Coaster flat to steep track wooden support clearance heights are different to RCT1.
|
||||
- Fix: [#25173] Desync when placing a park entrance in multiplayer.
|
||||
- Fix: [#25179] The LIM Launched Roller Coaster inline twists have incorrect wooden support clearance heights (original bug).
|
||||
- Fix: [#25207] Building a block brake on an LIM coaster does not automatically switch it to powered launch block sectioned mode.
|
||||
|
||||
0.4.26 (2025-09-06)
|
||||
------------------------------------------------------------------------
|
||||
|
||||
@@ -683,20 +683,18 @@ namespace OpenRCT2::GameActions
|
||||
ride->numBlockBrakes++;
|
||||
ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING;
|
||||
|
||||
// change the current mode to its circuit blocked equivalent
|
||||
RideMode newMode = RideMode::continuousCircuitBlockSectioned;
|
||||
if (ride->mode == RideMode::poweredLaunch)
|
||||
auto newMode = RideModeGetBlockSectionedCounterpart(ride->mode);
|
||||
if (ride->mode != newMode)
|
||||
{
|
||||
if (rtd.SupportsRideMode(RideMode::poweredLaunchBlockSectioned)
|
||||
|| getGameState().cheats.showAllOperatingModes)
|
||||
newMode = RideMode::poweredLaunchBlockSectioned;
|
||||
else
|
||||
newMode = RideMode::poweredLaunch;
|
||||
bool canSwitch = rtd.SupportsRideMode(newMode) || getGameState().cheats.showAllOperatingModes;
|
||||
if (canSwitch)
|
||||
{
|
||||
auto rideSetSetting = GameActions::RideSetSettingAction(
|
||||
ride->id, GameActions::RideSetSetting::Mode, static_cast<uint8_t>(newMode));
|
||||
ExecuteNested(&rideSetSetting, gameState);
|
||||
}
|
||||
}
|
||||
|
||||
auto rideSetSetting = GameActions::RideSetSettingAction(
|
||||
ride->id, GameActions::RideSetSetting::Mode, static_cast<uint8_t>(newMode));
|
||||
ExecuteNested(&rideSetSetting, gameState);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -450,13 +450,14 @@ namespace OpenRCT2::GameActions
|
||||
case TrackElemType::BlockBrakes:
|
||||
case TrackElemType::DiagBlockBrakes:
|
||||
ride->numBlockBrakes--;
|
||||
if (ride->numBlockBrakes == 0)
|
||||
if (ride->numBlockBrakes == 0 && ride->isBlockSectioned())
|
||||
{
|
||||
ride->windowInvalidateFlags |= RIDE_INVALIDATE_RIDE_OPERATING;
|
||||
RideMode newMode = RideMode::continuousCircuit;
|
||||
if (ride->mode == RideMode::poweredLaunchBlockSectioned)
|
||||
{
|
||||
newMode = RideMode::poweredLaunch;
|
||||
// Depending on the ride, the equivalent will be powered launch with or without passing station.
|
||||
newMode = ride->getRideTypeDescriptor().DefaultMode;
|
||||
}
|
||||
|
||||
auto rideSetSetting = GameActions::RideSetSettingAction(
|
||||
|
||||
@@ -88,6 +88,48 @@
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::TrackMetaData;
|
||||
|
||||
static constexpr auto kRideModeBlockSectionedCounterpart = std::to_array(
|
||||
{
|
||||
RideMode::normal, // RideMode::normal,
|
||||
RideMode::continuousCircuitBlockSectioned, // RideMode::continuousCircuit,
|
||||
RideMode::reverseInclineLaunchedShuttle, // RideMode::reverseInclineLaunchedShuttle,
|
||||
RideMode::poweredLaunchBlockSectioned, // RideMode::poweredLaunchPasstrough,
|
||||
RideMode::shuttle, // RideMode::shuttle,
|
||||
RideMode::boatHire, // RideMode::boatHire,
|
||||
RideMode::upwardLaunch, // RideMode::upwardLaunch,
|
||||
RideMode::rotatingLift, // RideMode::rotatingLift,
|
||||
RideMode::stationToStation, // RideMode::stationToStation,
|
||||
RideMode::singleRidePerAdmission, // RideMode::singleRidePerAdmission,
|
||||
RideMode::unlimitedRidesPerAdmission, // RideMode::unlimitedRidesPerAdmission ,
|
||||
RideMode::maze, // RideMode::maze,
|
||||
RideMode::race, // RideMode::race,
|
||||
RideMode::dodgems, // RideMode::dodgems,
|
||||
RideMode::swing, // RideMode::swing,
|
||||
RideMode::shopStall, // RideMode::shopStall,
|
||||
RideMode::rotation, // RideMode::rotation,
|
||||
RideMode::forwardRotation, // RideMode::forwardRotation,
|
||||
RideMode::backwardRotation, // RideMode::backwardRotation,
|
||||
RideMode::filmAvengingAviators, // RideMode::filmAvengingAviators,
|
||||
RideMode::mouseTails3DFilm, // RideMode::mouseTails3DFilm,
|
||||
RideMode::spaceRings, // RideMode::spaceRings,
|
||||
RideMode::beginners, // RideMode::beginners,
|
||||
RideMode::limPoweredLaunch, // RideMode::limPoweredLaunch,
|
||||
RideMode::filmThrillRiders, // RideMode::filmThrillRiders,
|
||||
RideMode::stormChasers3DFilm, // RideMode::stormChasers3DFilm,
|
||||
RideMode::spaceRaiders3DFilm, // RideMode::spaceRaiders3DFilm,
|
||||
RideMode::intense, // RideMode::intense,
|
||||
RideMode::berserk, // RideMode::berserk,
|
||||
RideMode::hauntedHouse, // RideMode::hauntedHouse,
|
||||
RideMode::circus, // RideMode::circus,
|
||||
RideMode::downwardLaunch, // RideMode::downwardLaunch,
|
||||
RideMode::crookedHouse, // RideMode::crookedHouse,
|
||||
RideMode::freefallDrop, // RideMode::freefallDrop,
|
||||
RideMode::continuousCircuitBlockSectioned, // RideMode::continuousCircuitBlockSectioned,
|
||||
RideMode::poweredLaunchBlockSectioned, // RideMode::poweredLaunch,
|
||||
RideMode::poweredLaunchBlockSectioned, // RideMode::poweredLaunchBlockSectioned,
|
||||
});
|
||||
static_assert(kRideModeBlockSectionedCounterpart.size() == EnumValue(RideMode::count));
|
||||
|
||||
RideMode& operator++(RideMode& d, int)
|
||||
{
|
||||
return d = (d == RideMode::count) ? RideMode::normal : static_cast<RideMode>(static_cast<uint8_t>(d) + 1);
|
||||
@@ -6038,3 +6080,9 @@ ResultWithMessage Ride::changeStatusCreateVehicles(bool isApplying, const Coords
|
||||
|
||||
return { true };
|
||||
}
|
||||
|
||||
RideMode RideModeGetBlockSectionedCounterpart(RideMode originalMode)
|
||||
{
|
||||
assert(originalMode < RideMode::count);
|
||||
return kRideModeBlockSectionedCounterpart[EnumValue(originalMode)];
|
||||
}
|
||||
|
||||
@@ -945,3 +945,5 @@ std::vector<RideId> GetTracklessRides();
|
||||
|
||||
void CircusMusicUpdate(Ride& ride);
|
||||
void DefaultMusicUpdate(Ride& ride);
|
||||
|
||||
RideMode RideModeGetBlockSectionedCounterpart(RideMode originalMode);
|
||||
|
||||
Reference in New Issue
Block a user