summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-11-27 17:13:49 +0000
committerbelugas <belugas@openttd.org>2007-11-27 17:13:49 +0000
commitb98847e48951c4e37737a729ef2a1c01ae468f8c (patch)
treeaca3c585347e4c3ad09d02252de1e3024066003f /src/industry_cmd.cpp
parente07925a5cbddc5a45197ef7147e9165eae1b4d5a (diff)
downloadopenttd-b98847e48951c4e37737a729ef2a1c01ae468f8c.tar.xz
(svn r11534) -Feature(newgrf): Implement property 23h for Industries.
This will add a cost to the removal of an industry using the cheat magic bulldozer. Note that the removal of regular or newgrf industries without specified removal cost will have no cost applied to. This is a difference from original spec, where a default base cost is added.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 28ff57720..ca920aabc 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -401,7 +401,7 @@ static CommandCost ClearTile_Industry(TileIndex tile, byte flags)
}
if (flags & DC_EXEC) delete i;
- return CommandCost();
+ return CommandCost(indspec->GetRemovalCost());
}
static void TransportIndustryGoods(TileIndex tile)
@@ -2227,6 +2227,11 @@ Money IndustrySpec::GetConstructionCost() const
)) >> 8;
}
+Money IndustrySpec::GetRemovalCost() const
+{
+ return (_price.remove_house * this->removal_cost_multiplier) >> 8;
+}
+
static CommandCost TerraformTile_Industry(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new)
{
if (AutoslopeEnabled()) {