From 3055d42fc4c0e58deb6b37ff712d754384b9c174 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 14 Sep 2007 22:27:40 +0000 Subject: (svn r11107) -Feature: some tool so one can still build tunnels under rails (and other structures) when the owner of the structure built it on foundations and if you have enough "empty" space ofcourse. One could use the tool for some other construction needs too. Patch by frosch. --- src/town_cmd.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/town_cmd.cpp') 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); } -- cgit v1.2.3-70-g09d2