From c125cfa6cc3fc45a1ad6cb4d7a5e64ce5f66cfce Mon Sep 17 00:00:00 2001 From: glx Date: Sat, 20 Sep 2008 17:43:06 +0000 Subject: (svn r14365) -Backport (r14364 from NoAI): add the ability do CmdBuildSingleSignal to directly place the correct signal, instead requiring multiple inputs before doing so --- src/rail_cmd.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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 */ -- cgit v1.2.3-70-g09d2