From 020c352ebf579b87e45a024115a8f5a4acc6171b Mon Sep 17 00:00:00 2001 From: tron Date: Sat, 27 Jan 2007 10:08:08 +0000 Subject: (svn r8426) -Fix Slightly simplify the code which determines whether to build a rail or a road bridge --- src/tunnelbridge_cmd.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index cdfb17c87..a90913a66 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -174,7 +174,6 @@ bool CheckBridge_Stuff(byte bridge_type, uint bridge_len) int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2) { int bridge_type; - TransportType transport; RailType railtype; uint x; uint y; @@ -202,12 +201,10 @@ int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2) // type of bridge if (HASBIT(p2, 15)) { - railtype = RAILTYPE_BEGIN; // ?? - transport = TRANSPORT_ROAD; + railtype = INVALID_RAILTYPE; // road bridge } else { if (!ValParamRailtype(GB(p2, 8, 8))) return CMD_ERROR; railtype = (RailType)GB(p2, 8, 8); - transport = TRANSPORT_RAIL; } x = TileX(end_tile); @@ -305,7 +302,7 @@ int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2) if (flags & DC_EXEC) { DiagDirection dir = AxisToDiagDir(direction); - if (transport == TRANSPORT_RAIL) { + if (railtype != INVALID_RAILTYPE) { MakeRailBridgeRamp(tile_start, _current_player, bridge_type, dir, railtype); MakeRailBridgeRamp(tile_end, _current_player, bridge_type, ReverseDiagDir(dir), railtype); } else { -- cgit v1.2.3-70-g09d2