]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util-pre.qh
Merge branches 'TimePath/oo', 'TimePath/buffsys', 'TimePath/gametypesys'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util-pre.qh
index e681998557388e4e4d262e8ec92402ca7f803377..18b46c8d321667e76d3a78896e4c9b23c3fc3c16 100644 (file)
 [[deprecated("use true")]] [[alias("true")]] const bool TRUE;
 [[deprecated("use false")]] [[alias("false")]] const bool FALSE;
 
+#define FOREACH(arr, start, end, cond, body) do { \
+    for (int i = start; i < end; ++i) {     \
+        const noref entity it = arr[i];     \
+        if (cond) { body }                  \
+    }                                       \
+} while(0)
+
 #ifdef GMQCC
     #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__)
 #else