#pragma once
+#if 1
+#define ITER_CONST const
+#else
+#define ITER_CONST
+#endif
+
#define FOREACH_ARRAY(arr, start, end, cond, body) \
MACRO_BEGIN \
{ \
for (int _i = start; _i < end; ++_i) \
{ \
const noref int i = _i; \
- const noref entity it = arr[i]; \
+ ITER_CONST noref entity it = arr[i]; \
if (cond) { LAMBDA(body) } \
} \
} MACRO_END
for (entity _it = list##_first; _it; (_it = _it.next, ++_i)) \
{ \
const noref int i = _i; \
- const noref entity it = _it; \
+ ITER_CONST noref entity it = _it; \
if (cond) { LAMBDA(body) } \
} \
} MACRO_END
for (entity _it = NULL; (_it = nextent(_it)); ++_i) \
{ \
const noref int i = _i; \
- const noref entity it = _it; \
+ ITER_CONST noref entity it = _it; \
if (cond) { LAMBDA(body) } \
} \
} MACRO_END
noref int i = 0; \
for (entity _it = list.ll_head; _it; (_it = _it.ll_next, ++i)) \
{ \
- noref entity it = _it.ll_data; \
+ ITER_CONST noref entity it = _it.ll_data; \
if (cond) { body } \
} \
} MACRO_END
#include "static.qh"
#ifdef MENUQC
- #define NULL (null_entity)
+ #define NULL (0, null_entity)
#else
- #define NULL (world)
+ #define NULL (0, world)
#endif
.vector origin;
for(int _i = 1; _i <= maxclients; ++_i) \
{ \
const noref int i = _i; \
- const noref entity it = ftoe(i); \
+ ITER_CONST noref entity it = ftoe(i); \
if(cond) { LAMBDA(body) } \
} \
} MACRO_END