forked from mirror/OpenTTD
(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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user