summaryrefslogtreecommitdiff
path: root/src/engine_base.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/engine_base.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/engine_base.h')
-rw-r--r--src/engine_base.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine_base.h b/src/engine_base.h
index 8e71c573d..e3e055164 100644
--- a/src/engine_base.h
+++ b/src/engine_base.h
@@ -82,8 +82,8 @@ struct EngineOverrideManager : SmallVector<EngineIDMapping, 256> {
extern EngineOverrideManager _engine_mngr;
-#define FOR_ALL_ENGINES_FROM(e, start) for (e = Engine::Get(start); e != NULL; e = (e->index + 1U < Engine::GetPoolSize()) ? Engine::Get(e->index + 1U) : NULL) if (e->IsValid())
-#define FOR_ALL_ENGINES(e) FOR_ALL_ENGINES_FROM(e, 0)
+#define FOR_ALL_ENGINES_FROM(var, start) FOR_ALL_ITEMS_FROM(Engine, engine_index, var, start)
+#define FOR_ALL_ENGINES(var) FOR_ALL_ENGINES_FROM(var, 0)
#define FOR_ALL_ENGINES_OF_TYPE(e, engine_type) FOR_ALL_ENGINES(e) if (e->type == engine_type)