Skip to content

Commit 0aa27cf

Browse files
committed
Fix ctrl-click signal cycling not checking custom signal style restrictions
1 parent b6768e4 commit 0aa27cf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rail_cmd.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,6 +1755,14 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
17551755
}
17561756

17571757
} else {
1758+
if (_ctrl_pressed && GetSignalStyle(tile, track) != 0) {
1759+
SignalType new_sigtype = GetSignalType(tile, track);
1760+
do {
1761+
new_sigtype = NextSignalType(new_sigtype, which_signals);
1762+
} while (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && IsSignalTypeUnsuitableForRealisticBraking(new_sigtype));
1763+
if (!is_style_usable(GetSignalVariant(tile, track), GetSignalStyle(tile, track), 1 << new_sigtype)) return_cmd_error(STR_ERROR_UNSUITABLE_SIGNAL_TYPE);
1764+
}
1765+
17581766
/* it is free to change orientation/pre-exit-combo signals */
17591767
cost = CommandCost();
17601768
}

0 commit comments

Comments
 (0)