diff options
author | terkhen <terkhen@openttd.org> | 2010-04-25 13:47:13 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-04-25 13:47:13 +0000 |
commit | 3be66a5e79e4046ea318c2a40a29c1eb308fae5a (patch) | |
tree | a33410dd83a43a4c3b0290eeb5f3166ec487a09b | |
parent | 28a57ee3f8b5fabb8d6994065bc1334d3ae4e566 (diff) | |
download | openttd-3be66a5e79e4046ea318c2a40a29c1eb308fae5a.tar.xz |
(svn r19717) -Fix: The cost of the first bridge type was added when building an aqueduct.
-rw-r--r-- | src/tunnelbridge_cmd.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 4e1d763fd..4df5a9133 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -470,10 +470,13 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u if (c != NULL) bridge_len = CalcBridgeLenCostFactor(bridge_len); - cost.AddCost((int64)bridge_len * _price[PR_BUILD_BRIDGE] * GetBridgeSpec(bridge_type)->price >> 8); + if (transport_type != TRANSPORT_WATER) { + cost.AddCost((int64)bridge_len * _price[PR_BUILD_BRIDGE] * GetBridgeSpec(bridge_type)->price >> 8); + } else { + /* Aqueducts use a separate base cost. */ + cost.AddCost((int64)bridge_len * _price[PR_CLEAR_WATER]); + } - /* Aqueducts are a little more expensive. */ - if (transport_type == TRANSPORT_WATER) cost.AddCost((int64)bridge_len * _price[PR_CLEAR_WATER]); } return cost; |