mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
When placing a block brake perform full operation mode switch
This commit is contained in:
committed by
Gymnasiast
parent
d927fefb86
commit
838cd4fc56
@@ -18,6 +18,7 @@
|
||||
#include "../world/MapAnimation.h"
|
||||
#include "../world/Surface.h"
|
||||
#include "GameAction.h"
|
||||
#include "RideSetSetting.hpp"
|
||||
|
||||
class TrackPlaceActionResult final : public GameActions::Result
|
||||
{
|
||||
@@ -561,14 +562,19 @@ public:
|
||||
ride->CableLiftLoc = mapLoc;
|
||||
break;
|
||||
case TrackElemType::BlockBrakes:
|
||||
{
|
||||
ride->num_block_brakes++;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_OPERATING;
|
||||
|
||||
ride->mode = RideMode::ContinuousCircuitBlockSectioned;
|
||||
RideMode newMode = RideMode::ContinuousCircuitBlockSectioned;
|
||||
if (ride->type == RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER)
|
||||
ride->mode = RideMode::PoweredLaunchBlockSectioned;
|
||||
newMode = RideMode::PoweredLaunchBlockSectioned;
|
||||
|
||||
auto rideSetSetting = RideSetSettingAction(
|
||||
ride->id, RideSetSetting::Mode, static_cast<uint8_t>(newMode));
|
||||
GameActions::ExecuteNested(&rideSetSetting);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (trackBlock->index == 0)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "../world/MapAnimation.h"
|
||||
#include "../world/Surface.h"
|
||||
#include "GameAction.h"
|
||||
#include "RideSetSetting.hpp"
|
||||
|
||||
DEFINE_GAME_ACTION(TrackRemoveAction, GAME_COMMAND_REMOVE_TRACK, GameActions::Result)
|
||||
{
|
||||
@@ -472,12 +473,17 @@ public:
|
||||
if (ride->num_block_brakes == 0)
|
||||
{
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_OPERATING;
|
||||
ride->mode = RideMode::ContinuousCircuit;
|
||||
RideMode newMode = RideMode::ContinuousCircuit;
|
||||
if (ride->type == RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER)
|
||||
{
|
||||
ride->mode = RideMode::PoweredLaunch;
|
||||
newMode = RideMode::PoweredLaunch;
|
||||
}
|
||||
|
||||
auto rideSetSetting = RideSetSettingAction(
|
||||
ride->id, RideSetSetting::Mode, static_cast<uint8_t>(newMode));
|
||||
GameActions::ExecuteNested(&rideSetSetting);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user