diff options
author | glx <glx@openttd.org> | 2008-09-20 17:43:06 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-09-20 17:43:06 +0000 |
commit | c125cfa6cc3fc45a1ad6cb4d7a5e64ce5f66cfce (patch) | |
tree | 233b3163b3b0be5bbfae3ab89f6ea9e063f6b517 /src | |
parent | fe5cc9c839406221ba71f9ef563987ec0bb92217 (diff) | |
download | openttd-c125cfa6cc3fc45a1ad6cb4d7a5e64ce5f66cfce.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
Diffstat (limited to 'src')
-rw-r--r-- | src/rail_cmd.cpp | 3 |
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 */ |