(svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).

This commit is contained in:
rubidium
2008-01-09 16:55:48 +00:00
parent b4337eba83
commit 46650c54b6
27 changed files with 190 additions and 294 deletions

View File

@@ -524,8 +524,6 @@ void ClearSnowLine(void)
*/
CommandCost CmdLandscapeClear(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
return _tile_type_procs[GetTileType(tile)]->clear_tile_proc(tile, flags);
}
@@ -537,7 +535,8 @@ CommandCost CmdLandscapeClear(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
*/
CommandCost CmdClearArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
CommandCost cost, ret, money;
CommandCost ret, money;
CommandCost cost(EXPENSES_CONSTRUCTION);
int ex;
int ey;
int sx, sy;
@@ -546,8 +545,6 @@ CommandCost CmdClearArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (p1 >= MapSize()) return CMD_ERROR;
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
/* make sure sx,sy are smaller than ex,ey */
ex = TileX(tile);
ey = TileY(tile);