# HG changeset patch # User tron # Date 1107208625 0 # Node ID 9ef7d43d4173dd800cb0c6c58631aec22de5e361 # Parent 792ada467c2122d6db82e9b3a49bf8c95701e582 (svn r1756) Cleanup: if cascade -> switch, uint -> TileIndex diff -r 792ada467c21 -r 9ef7d43d4173 town_cmd.c --- a/town_cmd.c Mon Jan 31 19:22:44 2005 +0000 +++ b/town_cmd.c Mon Jan 31 21:57:05 2005 +0000 @@ -1392,7 +1392,7 @@ void DeleteTown(Town *t) { Industry *i; - uint tile; + TileIndex tile; // Delete town authority window // and remove from list of sorted towns @@ -1406,18 +1406,24 @@ } // Go through all tiles and delete those belonging to the town - tile = 0; - do { - if (IsTileType(tile, MP_HOUSE)) { - if (ClosestTownFromTile(tile, (uint)-1) == t) { - DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); - } - } else if (IsTileType(tile, MP_TUNNELBRIDGE) || IsTileType(tile, MP_STREET)) { - if (_map_owner[tile] == OWNER_TOWN && ClosestTownFromTile(tile, (uint)-1) == t) { - DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); - } + for (tile = 0; tile < MapSize(); ++tile) { + switch (GetTileType(tile)) { + case MP_HOUSE: + if (ClosestTownFromTile(tile, (uint)-1) == t) + DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + break; + + case MP_STREET: + case MP_TUNNELBRIDGE: + if (_map_owner[tile] == OWNER_TOWN && + ClosestTownFromTile(tile, (uint)-1) == t) + DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); + break; + + default: + break; } - } while (++tile != MapSize()); + } t->xy = 0; DeleteName(t->townnametype);