Changeset - r16733:2c0bce03b3e4
[Not reviewed]
master
0 1 0
frosch - 14 years ago 2010-12-12 11:41:15
frosch@openttd.org
(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.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/landscape.cpp
Show inline comments
 
@@ -609,7 +609,8 @@ CommandCost CmdLandscapeClear(TileIndex 
 
{
 
	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]);
0 comments (0 inline, 0 general)