summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index d97dee3b4..3fbf26e1d 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -115,8 +115,7 @@ Town::~Town()
for (const Industry *i : Industry::Iterate()) assert(i->town != this);
/* ... and no object is related to us. */
- const Object *o;
- FOR_ALL_OBJECTS(o) assert(o->town != this);
+ for (const Object *o : Object::Iterate()) assert(o->town != this);
/* Check no tile is related to us. */
for (TileIndex tile = 0; tile < MapSize(); ++tile) {
@@ -159,8 +158,7 @@ void Town::PostDestructor(size_t index)
UpdateNearestTownForRoadTiles(false);
/* Give objects a new home! */
- Object *o;
- FOR_ALL_OBJECTS(o) {
+ for (Object *o : Object::Iterate()) {
if (o->town == nullptr) o->town = CalcClosestTownFromTile(o->location.tile, UINT_MAX);
}
}