]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util-pre.qh
Objectify buffs
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util-pre.qh
index 9d60ae0a9ae2797bfdaedea9632237e81554f564..cb2ef8f80e93bd43036e4f21ff6fe053f1bf7b5e 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