@@ -1317,13 +1317,13 @@ static CommandCost CmdSignalTrackHelper(
/* 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);
/* Test tiles in between for suitability as well if minimising gaps. */
bool test_only = minimise_gaps && signal_ctr < (last_used_ctr + signal_density);
bool test_only = !remove && minimise_gaps && signal_ctr < (last_used_ctr + signal_density);
CommandCost ret = DoCommand(tile, p1, signals, test_only ? flags & ~DC_EXEC : flags, remove ? CMD_REMOVE_SIGNALS : CMD_BUILD_SIGNALS);
if (ret.Succeeded()) {
/* Remember last track piece where we can place a signal. */
last_suitable_ctr = signal_ctr;
last_suitable_tile = tile;
Status change: