diff options
author | tron <tron@openttd.org> | 2007-01-27 10:08:08 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-01-27 10:08:08 +0000 |
commit | 020c352ebf579b87e45a024115a8f5a4acc6171b (patch) | |
tree | 02aaafbd447a95ada2e715fc693a3f36848a7032 /src | |
parent | e0df42b3a301d65a44785f2043a94c78b38c7bf2 (diff) | |
download | openttd-020c352ebf579b87e45a024115a8f5a4acc6171b.tar.xz |
(svn r8426) -Fix
Slightly simplify the code which determines whether to build a rail or a road bridge
Diffstat (limited to 'src')
-rw-r--r-- | src/tunnelbridge_cmd.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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 { |