File diff r7581:0085036e989e → r7582:dfefb1216e6f
src/town_cmd.cpp
Show inline comments
 
@@ -38,12 +38,13 @@
 
#include "newgrf.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_house.h"
 
#include "newgrf_commons.h"
 
#include "newgrf_townname.h"
 
#include "misc/autoptr.hpp"
 
#include "autoslope.h"
 

	
 
/* Initialize the town-pool */
 
DEFINE_OLD_POOL_GENERIC(Town, Town)
 

	
 
Town::Town(TileIndex tile)
 
{
 
@@ -2306,12 +2307,21 @@ void InitializeTowns()
 
	_total_towns = 0;
 
	_town_sort_dirty = true;
 
}
 

	
 
static CommandCost TerraformTile_Town(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new)
 
{
 
	if (AutoslopeEnabled()) {
 
		HouseID house = GetHouseType(tile);
 
		HouseSpec *hs = GetHouseSpecs(house);
 

	
 
		/* Here we differ from TTDP by checking TILE_NOT_SLOPED */
 
		if (((hs->building_flags & TILE_NOT_SLOPED) == 0) && !IsSteepSlope(tileh_new) &&
 
			(GetTileMaxZ(tile) == z_new + GetSlopeMaxZ(tileh_new))) return _price.terraform;
 
	}
 

	
 
	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
}
 

	
 
extern const TileTypeProcs _tile_type_town_procs = {
 
	DrawTile_Town,           /* draw_tile_proc */
 
	GetSlopeZ_Town,          /* get_slope_z_proc */