Mercurial > hg > openttd
changeset 15101:7c5b19d2816c draft
(svn r19727) -Fix (r19720) [FS#3795]: Demolishing bridges or aqueducts caused a crash.
author | terkhen <terkhen@openttd.org> |
---|---|
date | Sun, 25 Apr 2010 20:56:42 +0000 |
parents | 8ef3605330de |
children | 1516e9f0747e |
files | src/tunnelbridge_cmd.cpp |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -750,6 +750,8 @@ ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM, flags); } + Money base_cost = (GetTunnelBridgeTransportType(tile) != TRANSPORT_WATER) ? _price[PR_CLEAR_BRIDGE] : _price[PR_CLEAR_AQUEDUCT]; + if (flags & DC_EXEC) { /* read this value before actual removal of bridge */ bool rail = GetTunnelBridgeTransportType(tile) == TRANSPORT_RAIL; @@ -787,7 +789,6 @@ } } - Money base_cost = (GetTunnelBridgeTransportType(tile) != TRANSPORT_WATER) ? _price[PR_CLEAR_BRIDGE] : _price[PR_CLEAR_AQUEDUCT]; return CommandCost(EXPENSES_CONSTRUCTION, (GetTunnelBridgeLength(tile, endtile) + 2) * base_cost); }