summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-12-12 11:41:15 +0000
committerfrosch <frosch@openttd.org>2010-12-12 11:41:15 +0000
commit5910bde58367764387e00c76e14d7465be942e7f (patch)
treee6add8b311e827a4be1e0897b22fe25aa03a0a8a /src
parent0575c8fec977309b5785ae9d76accf7b5afd6bb8 (diff)
downloadopenttd-5910bde58367764387e00c76e14d7465be942e7f.tar.xz
(svn r21476) -Fix [FS#4299]: DC_FORCE_CLEAR_TILE should only add extra cost for clearing water for stuff which results in water after clearing.
Diffstat (limited to 'src')
-rw-r--r--src/landscape.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index cbf2815c4..a0ffb0cfd 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -609,7 +609,8 @@ CommandCost CmdLandscapeClear(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
{
CommandCost cost(EXPENSES_CONSTRUCTION);
bool do_clear = false;
- if ((flags & DC_FORCE_CLEAR_TILE) && HasTileWaterClass(tile) && IsTileOnWater(tile)) {
+ /* Test for stuff which results in water when cleared. Then add the cost to also clear the water. */
+ if ((flags & DC_FORCE_CLEAR_TILE) && HasTileWaterClass(tile) && IsTileOnWater(tile) && !IsWaterTile(tile) && !IsCoastTile(tile)) {
if ((flags & DC_AUTO) && GetWaterClass(tile) == WATER_CLASS_CANAL) return_cmd_error(STR_ERROR_MUST_DEMOLISH_CANAL_FIRST);
do_clear = true;
cost.AddCost(GetWaterClass(tile) == WATER_CLASS_CANAL ? _price[PR_CLEAR_CANAL] : _price[PR_CLEAR_WATER]);