Change TunnelBridgeIsFree across_only to a mode enum type

This commit is contained in:
Jonathan G Rennison
2023-05-06 15:48:27 +01:00
parent f94e43c940
commit 09e03fb6b2
5 changed files with 23 additions and 16 deletions

View File

@@ -1496,7 +1496,7 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1,
if (!ValParamTrackOrientation(track) || !IsTrackAcrossTunnelBridge(tile, track)) {
return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK);
}
CommandCost ret = TunnelBridgeIsFree(tile, GetOtherTunnelBridgeEnd(tile), nullptr, true);
CommandCost ret = TunnelBridgeIsFree(tile, GetOtherTunnelBridgeEnd(tile), nullptr, TBIFM_ACROSS_ONLY);
if (ret.Failed()) return ret;
} else if (!ValParamTrackOrientation(track) || !IsPlainRailTile(tile) || !HasTrack(tile, track)) {
return_cmd_error(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK);
@@ -2185,7 +2185,7 @@ CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1
}
if (!IsTunnelBridgeWithSignalSimulation(tile)) return_cmd_error(STR_ERROR_THERE_ARE_NO_SIGNALS);
TileIndex end = GetOtherTunnelBridgeEnd(tile);
CommandCost ret = TunnelBridgeIsFree(tile, end, nullptr, true);
CommandCost ret = TunnelBridgeIsFree(tile, end, nullptr, TBIFM_ACROSS_ONLY);
if (ret.Failed()) return ret;
cost *= GetTunnelBridgeSignalSimulationSignalCount(tile, end);