Mercurial > hg > openttd
changeset 15093:e5e511b46e2b draft
(svn r19719) -Codechange: When building a lock, do not add the cost of building canals if they are already built.
author | terkhen <terkhen@openttd.org> |
---|---|
date | Sun, 25 Apr 2010 13:52:08 +0000 |
parents | 43aa8105fc82 |
children | 217e3f1c5b11 |
files | src/water_cmd.cpp |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -213,6 +213,7 @@ ret = DoCommand(tile - delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (ret.Failed()) return ret; cost.AddCost(ret); + cost.AddCost(_price[PR_CLEAR_WATER]); } if (GetTileSlope(tile - delta, NULL) != SLOPE_FLAT) { return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); @@ -225,6 +226,7 @@ ret = DoCommand(tile + delta, 0, 0, flags, CMD_LANDSCAPE_CLEAR); if (ret.Failed()) return ret; cost.AddCost(ret); + cost.AddCost(_price[PR_CLEAR_WATER]); } if (GetTileSlope(tile + delta, NULL) != SLOPE_FLAT) { return_cmd_error(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION); @@ -244,7 +246,7 @@ MarkCanalsAndRiversAroundDirty(tile - delta); MarkCanalsAndRiversAroundDirty(tile + delta); } - cost.AddCost(_price[PR_CLEAR_WATER] * 22 >> 3); + cost.AddCost(_price[PR_CLEAR_WATER] * 3 / 4); return cost; }