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 | 46650c54b6a13ef5980eadb24995481f1fd83712 (patch) | |
tree | a0181571819fca45c3cc170c7ce718009cb12535 /src/tree_cmd.cpp | |
parent | b4337eba83e34ddaac29684d78202ae9623e9240 (diff) | |
download | openttd-46650c54b6a13ef5980eadb24995481f1fd83712.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/tree_cmd.cpp')
-rw-r--r-- | src/tree_cmd.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index f1d0b58aa..e73de21cb 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -273,7 +273,7 @@ void GenerateTrees() CommandCost CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { StringID msg = INVALID_STRING_ID; - CommandCost cost; + CommandCost cost(EXPENSES_OTHER); int ex; int ey; int sx, sy, x, y; @@ -282,8 +282,6 @@ CommandCost CmdPlantTree(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) /* Check the tree type. It can be random or some valid value within the current climate */ if (p1 != (uint)-1 && p1 - _tree_base_by_landscape[_opt.landscape] >= _tree_count_by_landscape[_opt.landscape]) return CMD_ERROR; - SET_EXPENSES_TYPE(EXPENSES_OTHER); - // make sure sx,sy are smaller than ex,ey ex = TileX(tile); ey = TileY(tile); @@ -499,7 +497,7 @@ static CommandCost ClearTile_Trees(TileIndex tile, byte flags) if (flags & DC_EXEC) DoClearSquare(tile); - return CommandCost(num * _price.remove_trees); + return CommandCost(EXPENSES_CONSTRUCTION, num * _price.remove_trees); } static void GetAcceptedCargo_Trees(TileIndex tile, AcceptedCargo ac) |