(svn r16966) -Codechange: BEGIN_TILE_LOOP and END_TILE_LOOP reworked into TILE_LOOP, which means no more duplication of parameters between BEGIN_TILE_LOOP and END_TILE_LOOP

This commit is contained in:
rubidium
2009-07-26 21:50:30 +00:00
parent 3321f45246
commit 30d9e54279
13 changed files with 71 additions and 87 deletions

View File

@@ -385,7 +385,7 @@ CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
Money money = GetAvailableMoneyForCommand();
CommandCost cost(EXPENSES_CONSTRUCTION);
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
TILE_LOOP(tile2, size_x, size_y, tile) {
uint curh = TileHeight(tile2);
while (curh != h) {
CommandCost ret = DoCommand(tile2, SLOPE_N, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
@@ -403,7 +403,7 @@ CommandCost CmdLevelLand(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
cost.AddCost(ret);
curh += (curh > h) ? -1 : 1;
}
} END_TILE_LOOP(tile2, size_x, size_y, tile)
}
return (cost.GetCost() == 0) ? CMD_ERROR : cost;
}