diff options
author | frosch <frosch@openttd.org> | 2010-12-12 11:41:15 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-12-12 11:41:15 +0000 |
commit | 5910bde58367764387e00c76e14d7465be942e7f (patch) | |
tree | e6add8b311e827a4be1e0897b22fe25aa03a0a8a /src/landscape.cpp | |
parent | 0575c8fec977309b5785ae9d76accf7b5afd6bb8 (diff) | |
download | openttd-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/landscape.cpp')
-rw-r--r-- | src/landscape.cpp | 3 |
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]); |