diff options
author | smatz <smatz@openttd.org> | 2008-01-04 19:45:29 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-01-04 19:45:29 +0000 |
commit | 7302d8c88b25e08a414ebf4e8e83abffc1c3961a (patch) | |
tree | 9a2deee8e62f246ba97175135518232409950b73 /src/rail_cmd.cpp | |
parent | 9299f76af42eb4c8ca8d7077fc60f87c2d962047 (diff) | |
download | openttd-7302d8c88b25e08a414ebf4e8e83abffc1c3961a.tar.xz |
(svn r11760) -Codechange: unify the way how other end of a tunnel/bridge is determined at some places
-Fix: adding road/tram to tram/road bridge was cheaper by one tile
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r-- | src/rail_cmd.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index d550b311c..810329496 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -931,7 +931,7 @@ static bool CheckSignalAutoFill(TileIndex &tile, Trackdir &trackdir, int &signal /* Skip to end of tunnel or bridge * note that tile is a parameter by reference, so it must be updated */ - tile = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile); + tile = GetOtherTunnelBridgeEnd(tile); signal_ctr += 2 + DistanceMax(orig_tile, tile) * 2; return true; @@ -1262,7 +1262,7 @@ CommandCost CmdConvertRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) break; case MP_TUNNELBRIDGE: { - TileIndex endtile = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile); + TileIndex endtile = GetOtherTunnelBridgeEnd(tile); /* If both ends of tunnel/bridge are in the range, do not try to convert twice - * it would cause assert because of different test and exec runs */ @@ -1938,8 +1938,7 @@ static bool SignalVehicleCheck(TileIndex tile, uint track) { if (IsTileType(tile, MP_TUNNELBRIDGE)) { /* Locate vehicles in tunnels or on bridges */ - TileIndex endtile = IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile); - return GetVehicleTunnelBridge(tile, endtile) != NULL; + return GetVehicleTunnelBridge(tile, GetOtherTunnelBridgeEnd(tile)) != NULL; } else { return VehicleFromPos(tile, &track, &SignalVehicleCheckProc) != NULL; } |