diff options
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r-- | src/landscape.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp index d69275dd3..d5b06422a 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -667,8 +667,7 @@ CommandCost CmdClearArea(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 const Company *c = (flags & (DC_AUTO | DC_BANKRUPT)) ? NULL : Company::GetIfValid(_current_company); int limit = (c == NULL ? INT32_MAX : GB(c->clear_limit, 16, 16)); - TileArea ta(tile, p1); - TileIterator *iter = HasBit(p2, 0) ? (TileIterator *)new DiagonalTileIterator(tile, p1) : new OrthogonalTileIterator(ta); + TileIterator *iter = HasBit(p2, 0) ? (TileIterator *)new DiagonalTileIterator(tile, p1) : new OrthogonalTileIterator(tile, p1); for (; *iter != INVALID_TILE; ++(*iter)) { TileIndex t = *iter; CommandCost ret = DoCommand(t, 0, 0, flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR); @@ -692,11 +691,10 @@ CommandCost CmdClearArea(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 /* draw explosion animation... * Disable explosions when game is paused. Looks silly and blocks the view. */ - TileIndex off = t - ta.tile; - if ((TileX(off) == 0 || TileX(off) == ta.w - 1U) && (TileY(off) == 0 || TileY(off) == ta.h - 1U) && _pause_mode == PM_UNPAUSED) { - /* big explosion in each corner, or small explosion for single tiles */ + if ((t == tile || t == p1) && _pause_mode == PM_UNPAUSED) { + /* big explosion in two corners, or small explosion for single tiles */ CreateEffectVehicleAbove(TileX(t) * TILE_SIZE + TILE_SIZE / 2, TileY(t) * TILE_SIZE + TILE_SIZE / 2, 2, - ta.w == 1 && ta.h == 1 ? EV_EXPLOSION_SMALL : EV_EXPLOSION_LARGE + TileX(tile) == TileX(p1) && TileY(tile) == TileY(p1) ? EV_EXPLOSION_SMALL : EV_EXPLOSION_LARGE ); } } else { |