File diff r18259:00667dab1f07 → r18260:9616113792ef
src/station_cmd.cpp
Show inline comments
 
@@ -655,25 +655,25 @@ CommandCost ClearTile_Station(TileIndex 
 
 * @param check_bridge Check for the existance of a bridge.
 
 * @return The cost in case of success, or an error code if it failed.
 
 */
 
CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge = true)
 
{
 
	if (check_bridge && MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) {
 
		return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
 
	}
 

	
 
	CommandCost ret = EnsureNoVehicleOnGround(tile);
 
	if (ret.Failed()) return ret;
 

	
 
	uint z;
 
	int z;
 
	Slope tileh = GetTileSlope(tile, &z);
 

	
 
	/* Prohibit building if
 
	 *   1) The tile is "steep" (i.e. stretches two height levels).
 
	 *   2) The tile is non-flat and the build_on_slopes switch is disabled.
 
	 */
 
	if ((!allow_steep && IsSteepSlope(tileh)) ||
 
			((!_settings_game.construction.build_on_slopes) && tileh != SLOPE_FLAT)) {
 
		return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
 
	}
 

	
 
	CommandCost cost(EXPENSES_CONSTRUCTION);
 
@@ -2575,25 +2575,25 @@ static void DrawTile_Station(TileInfo *t
 
		/* Some stations are not owner by a company, namely oil rigs */
 
		palette = PALETTE_TO_GREY;
 
	}
 

	
 
	if (layout == NULL && (t == NULL || t->seq == NULL)) t = GetStationTileLayout(GetStationType(ti->tile), GetStationGfx(ti->tile));
 

	
 
	/* don't show foundation for docks */
 
	if (ti->tileh != SLOPE_FLAT && !IsDock(ti->tile)) {
 
		if (statspec != NULL && HasBit(statspec->flags, SSF_CUSTOM_FOUNDATIONS)) {
 
			/* Station has custom foundations.
 
			 * Check whether the foundation continues beyond the tile's upper sides. */
 
			uint edge_info = 0;
 
			uint z;
 
			int z;
 
			Slope slope = GetFoundationPixelSlope(ti->tile, &z);
 
			if (!HasFoundationNW(ti->tile, slope, z)) SetBit(edge_info, 0);
 
			if (!HasFoundationNE(ti->tile, slope, z)) SetBit(edge_info, 1);
 
			SpriteID image = GetCustomStationFoundationRelocation(statspec, st, ti->tile, tile_layout, edge_info);
 

	
 
			if (HasBit(statspec->flags, SSF_EXTENDED_FOUNDATIONS)) {
 
				/* Station provides extended foundations. */
 

	
 
				static const uint8 foundation_parts[] = {
 
					0, 0, 0, 0, // Invalid,  Invalid,   Invalid,   SLOPE_SW
 
					0, 1, 2, 3, // Invalid,  SLOPE_EW,  SLOPE_SE,  SLOPE_WSE
 
					0, 4, 5, 6, // Invalid,  SLOPE_NW,  SLOPE_NS,  SLOPE_NWS