summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index f399f09a2..d192e1a28 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -41,6 +41,7 @@
#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)
@@ -2309,6 +2310,15 @@ void InitializeTowns()
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);
}