summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-09-20 17:43:06 +0000
committerglx <glx@openttd.org>2008-09-20 17:43:06 +0000
commit0b65ce9d46ca9393a4565b0a5298f7f16a650238 (patch)
tree233b3163b3b0be5bbfae3ab89f6ea9e063f6b517
parent8b0d8589e38a49254c5e129f814f65d6650f563d (diff)
downloadopenttd-0b65ce9d46ca9393a4565b0a5298f7f16a650238.tar.xz
(svn r14365) -Backport (r14364 from NoAI): add the ability do CmdBuildSingleSignal to directly place the correct signal, instead requiring multiple inputs before doing so
-rw-r--r--src/rail_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 81c81640a..5c496ad76 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -831,6 +831,7 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
* - p1 = (bit 8) - convert the present signal type and variant
* - p1 = (bit 9-11)- start cycle from this signal type
* - p1 = (bit 12-14)-wrap around after this signal type
+ * - p1 = (bit 15-16)-cycle the signal direction this many times
* @param p2 used for CmdBuildManySignals() to copy direction of first signal
* TODO: p2 should be replaced by two bits for "along" and "against" the track.
*/
@@ -844,6 +845,7 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, uint32 flags, uint32 p1, uint32
SignalType cycle_start = (SignalType)GB(p1, 9, 3);
SignalType cycle_stop = (SignalType)GB(p1, 12, 3);
CommandCost cost;
+ uint num_dir_cycle = GB(p1, 15, 2);
if (sigtype > SIGTYPE_LAST) return CMD_ERROR;
@@ -920,6 +922,7 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, uint32 flags, uint32 p1, uint32
SetPresentSignals(tile, GetPresentSignals(tile) | (IsPbsSignal(sigtype) ? KillFirstBit(SignalOnTrack(track)) : SignalOnTrack(track)));
SetSignalType(tile, track, sigtype);
SetSignalVariant(tile, track, sigvar);
+ while (num_dir_cycle-- > 0) CycleSignalSide(tile, track);
} else {
if (convert_signal) {
/* convert signal button pressed */