diff options
author | rubidium <rubidium@openttd.org> | 2008-01-09 16:55:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-01-09 16:55:48 +0000 |
commit | 0365c1f33ba130bcfc663309b806fe65d730381f (patch) | |
tree | a0181571819fca45c3cc170c7ce718009cb12535 /src/terraform_cmd.cpp | |
parent | 98b4fa7c070f2433539f2c399129c24fba842632 (diff) | |
download | openttd-0365c1f33ba130bcfc663309b806fe65d730381f.tar.xz |
(svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
Diffstat (limited to 'src/terraform_cmd.cpp')
-rw-r--r-- | src/terraform_cmd.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp index 138506231..b50e4bf07 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -148,7 +148,7 @@ static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile) */ static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int height) { - CommandCost total_cost = CommandCost(); + CommandCost total_cost(EXPENSES_CONSTRUCTION); assert(tile < MapSize()); @@ -228,11 +228,9 @@ static CommandCost TerraformTileHeight(TerraformerState *ts, TileIndex tile, int CommandCost CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { TerraformerState ts; - CommandCost total_cost = CommandCost(); + CommandCost total_cost(EXPENSES_CONSTRUCTION); int direction = (p2 != 0 ? 1 : -1); - SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); - _terraform_err_tile = 0; ts.modheight_count = ts.tile_table_count = 0; @@ -358,12 +356,10 @@ CommandCost CmdLevelLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) uint h, oldh, curh; CommandCost money; CommandCost ret; - CommandCost cost; + CommandCost cost(EXPENSES_CONSTRUCTION); if (p1 >= MapSize()) return CMD_ERROR; - SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); - /* remember level height */ oldh = TileHeight(p1); |