summaryrefslogtreecommitdiff
path: root/src/unmovable_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-09-14 22:27:40 +0000
committerrubidium <rubidium@openttd.org>2007-09-14 22:27:40 +0000
commitfef64185b87e4517b7760e017171d646eaa1eb69 (patch)
tree66f89fc328e49813581c22632a0a9cb21d7c2eb8 /src/unmovable_cmd.cpp
parent5647bd5157b623348feb202623057fd84eb9c3c5 (diff)
downloadopenttd-fef64185b87e4517b7760e017171d646eaa1eb69.tar.xz
(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.
Diffstat (limited to 'src/unmovable_cmd.cpp')
-rw-r--r--src/unmovable_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index c3495d715..8bc8f3fa1 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -24,6 +24,7 @@
#include "table/unmovable_land.h"
#include "genworld.h"
#include "bridge.h"
+#include "autoslope.h"
/** Destroy a HQ.
* During normal gameplay you can only implicitely destroy a HQ when you are
@@ -408,6 +409,10 @@ static CommandCost TerraformTile_Unmovable(TileIndex tile, uint32 flags, uint z_
/* Owned land remains unsold */
if (IsOwnedLand(tile) && CheckTileOwnership(tile)) return CommandCost();
+ if (AutoslopeEnabled() && (IsStatue(tile) || IsCompanyHQ(tile))) {
+ if (!IsSteepSlope(tileh_new) && (z_new + GetSlopeMaxZ(tileh_new) == GetTileMaxZ(tile))) return _price.terraform;
+ }
+
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
}