Changeset - r15081:ec58df7b6b94
[Not reviewed]
master
0 1 0
terkhen - 14 years ago 2010-04-25 13:47:13
terkhen@openttd.org
(svn r19717) -Fix: The cost of the first bridge type was added when building an aqueduct.
1 file changed with 6 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -467,16 +467,19 @@ CommandCost CmdBuildBridge(TileIndex end
 
	Company *c = Company::GetIfValid(_current_company);
 
	if (!(flags & DC_QUERY_COST) || (c != NULL && c->is_ai)) {
 
		bridge_len += 2; // begin and end tiles/ramps
 

	
 
		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;
 
}
 

	
 

	
0 comments (0 inline, 0 general)