Changeset - r18494:ba07a01101f5
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-11-29 21:09:58
rubidium@openttd.org
(svn r23348) -Fix [FS#4679]: make signal removal behaviour work the same regardless of autofill, i.e. always removal all signals instead those at the signal interval
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -1212,25 +1212,25 @@ static CommandCost CmdSignalTrackHelper(
 
	 * signals_density    - setting to put signal on every Nth tile (double space on |, -- tracks)
 
	 **********
 
	 * trackdir   - trackdir to build with autorail
 
	 * semaphores - semaphores or signals
 
	 * signals    - is there a signal/semaphore on the first tile, copy its style (two-way/single-way)
 
	 *              and convert all others to semaphore/signal
 
	 * remove     - 1 remove signals, 0 build signals */
 
	int signal_ctr = 0;
 
	CommandCost last_error = CMD_ERROR;
 
	bool had_success = false;
 
	for (;;) {
 
		/* only build/remove signals with the specified density */
 
		if ((remove && autofill) || signal_ctr % signal_density == 0) {
 
		if (remove || signal_ctr % signal_density == 0) {
 
			uint32 p1 = GB(TrackdirToTrack(trackdir), 0, 3);
 
			SB(p1, 3, 1, mode);
 
			SB(p1, 4, 1, semaphores);
 
			SB(p1, 5, 3, sigtype);
 
			if (!remove && signal_ctr == 0) SetBit(p1, 17);
 

	
 
			/* Pick the correct orientation for the track direction */
 
			signals = 0;
 
			if (HasBit(signal_dir, 0)) signals |= SignalAlongTrackdir(trackdir);
 
			if (HasBit(signal_dir, 1)) signals |= SignalAgainstTrackdir(trackdir);
 

	
 
			CommandCost ret = DoCommand(tile, p1, signals, flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS);
0 comments (0 inline, 0 general)