Skip to content

Commit

Permalink
Fix ctrl-click signal cycling not checking custom signal style restri…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
JGRennison committed Dec 6, 2023
1 parent b6768e4 commit 0aa27cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rail_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,14 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
}

} else {
if (_ctrl_pressed && GetSignalStyle(tile, track) != 0) {
SignalType new_sigtype = GetSignalType(tile, track);
do {
new_sigtype = NextSignalType(new_sigtype, which_signals);
} while (_settings_game.vehicle.train_braking_model == TBM_REALISTIC && IsSignalTypeUnsuitableForRealisticBraking(new_sigtype));
if (!is_style_usable(GetSignalVariant(tile, track), GetSignalStyle(tile, track), 1 << new_sigtype)) return_cmd_error(STR_ERROR_UNSUITABLE_SIGNAL_TYPE);
}

/* it is free to change orientation/pre-exit-combo signals */
cost = CommandCost();
}
Expand Down

0 comments on commit 0aa27cf

Please sign in to comment.