summaryrefslogtreecommitdiff
path: root/src/town.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-05-22 14:23:36 +0000
committersmatz <smatz@openttd.org>2009-05-22 14:23:36 +0000
commit04723b240ebc7384954f73590be517ad2a47ce04 (patch)
treeac4bd41288d9d96a256ea0c702d1a75502bfecd9 /src/town.h
parentb687ac51ee5e8628ed56319df573c903c0c86ef3 (diff)
downloadopenttd-04723b240ebc7384954f73590be517ad2a47ce04.tar.xz
(svn r16377) -Codechange: unify FOR_ALL_* macros, use separate index variable instead of var->index
Diffstat (limited to 'src/town.h')
-rw-r--r--src/town.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/town.h b/src/town.h
index d653fa59e..ead399d0c 100644
--- a/src/town.h
+++ b/src/town.h
@@ -326,8 +326,8 @@ static inline Town *GetRandomTown()
Town *CalcClosestTownFromTile(TileIndex tile, uint threshold = UINT_MAX);
-#define FOR_ALL_TOWNS_FROM(t, start) for (t = Town::Get(start); t != NULL; t = (t->index + 1U < Town::GetPoolSize()) ? Town::Get(t->index + 1U) : NULL) if (t->IsValid())
-#define FOR_ALL_TOWNS(t) FOR_ALL_TOWNS_FROM(t, 0)
+#define FOR_ALL_TOWNS_FROM(var, start) FOR_ALL_ITEMS_FROM(Town, town_index, var, start)
+#define FOR_ALL_TOWNS(var) FOR_ALL_TOWNS_FROM(var, 0)
extern Town *_cleared_town;
extern int _cleared_town_rating;