Changeset - r9492:2708969ab966
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-06-11 14:51:31
rubidium@openttd.org
(svn r13468) -Fix: make aqueducts a little more expensive than normal bridges and disable terraforming of aqueduct bridgeheads; one can't terraform normal canal tiles either.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -447,24 +447,27 @@ not_valid_below:;
 

	
 
	/* for human player that builds the bridge he gets a selection to choose from bridges (DC_QUERY_COST)
 
	 * It's unnecessary to execute this command every time for every bridge. So it is done only
 
	 * and cost is computed in "bridge_gui.c". For AI, Towns this has to be of course calculated
 
	 */
 
	if (!(flags & DC_QUERY_COST) || (IsValidPlayer(_current_player) && GetPlayer(_current_player)->is_ai)) {
 
		bridge_len += 2; // begin and end tiles/ramps
 

	
 
		if (IsValidPlayer(_current_player) && !_is_old_ai_player)
 
			bridge_len = CalcBridgeLenCostFactor(bridge_len);
 

	
 
		cost.AddCost((int64)bridge_len * _price.build_bridge * GetBridgeSpec(bridge_type)->price >> 8);
 

	
 
		/* Aqueducts are a little more expensive. */
 
		if (transport_type == TRANSPORT_WATER) cost.AddCost((int64)bridge_len * _price.clear_water);
 
	}
 

	
 
	return cost;
 
}
 

	
 

	
 
/** Build Tunnel.
 
 * @param start_tile start tile of tunnel
 
 * @param flags type of operation
 
 * @param p1 railtype or roadtypes. bit 9 set means road tunnel
 
 * @param p2 unused
 
 */
 
@@ -1420,25 +1423,25 @@ static VehicleEnterTileStatus VehicleEnt
 
					}
 
					break;
 

	
 
				default: NOT_REACHED();
 
			}
 
		}
 
	}
 
	return VETSB_CONTINUE;
 
}
 

	
 
static CommandCost TerraformTile_TunnelBridge(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new)
 
{
 
	if (_settings_game.construction.build_on_slopes && AutoslopeEnabled() && IsBridge(tile)) {
 
	if (_settings_game.construction.build_on_slopes && AutoslopeEnabled() && IsBridge(tile) && GetTunnelBridgeTransportType(tile) != TRANSPORT_WATER) {
 
		DiagDirection direction = GetTunnelBridgeDirection(tile);
 
		Axis axis = DiagDirToAxis(direction);
 
		CommandCost res;
 
		uint z_old;
 
		Slope tileh_old = GetTileSlope(tile, &z_old);
 

	
 
		/* Check if new slope is valid for bridges in general (so we can savely call GetBridgeFoundation()) */
 
		if ((direction == DIAGDIR_NW) || (direction == DIAGDIR_NE)) {
 
			CheckBridgeSlopeSouth(axis, &tileh_old, &z_old);
 
			res = CheckBridgeSlopeSouth(axis, &tileh_new, &z_new);
 
		} else {
 
			CheckBridgeSlopeNorth(axis, &tileh_old, &z_old);
0 comments (0 inline, 0 general)