#if defined(CSQC)
entity(.string fld, string match, .entity tofield) _findchainstring_tofield = #402;
entity(.entity fld, entity match, .entity tofield) findchainentity_tofield = #403;
+ entity(.float fld, float match, .entity tofield) _findchainfloat_tofield = #403;
entity(.float fld, float match, .entity tofield) _findchainflags_tofield = #450;
#elif defined(SVQC)
entity(.string fld, string match, .entity tofield) _findchainstring_tofield = #402;
entity(.entity fld, entity match, .entity tofield) findchainentity_tofield = #403;
+ entity(.float fld, float match, .entity tofield) _findchainfloat_tofield = #403;
entity(.float fld, float match, .entity tofield) _findchainflags_tofield = #450;
#elif defined(MENUQC)
entity(.string fld, string match, .entity tofield) _findchainstring_tofield = #26;
entity(.entity fld, entity match, .entity tofield) findchainentity_tofield = #27;
+ entity(.float fld, float match, .entity tofield) _findchainfloat_tofield = #27;
entity(.float fld, float match, .entity tofield) _findchainflags_tofield = #88;
#endif
} \
} MACRO_END
-#define FOREACH_ENTITY_FLAGS(fld, flags, body) \
+#define FOREACH_ENTITY_FLOAT(fld, match, body) \
MACRO_BEGIN { \
int i = 0; \
- for (entity it = _findchainflags_tofield(fld, flags, _FOREACH_ENTITY_next); it; (it = it._FOREACH_ENTITY_next, ++i)) \
+ for (entity it = _findchainfloat_tofield(fld, match, _FOREACH_ENTITY_next); it; (it = it._FOREACH_ENTITY_next, ++i)) \
+ { \
+ LAMBDA(body) \
+ } \
+ } MACRO_END
+
+#define FOREACH_ENTITY_FLAGS(fld, match, body) \
+ MACRO_BEGIN { \
+ int i = 0; \
+ for (entity it = _findchainflags_tofield(fld, match, _FOREACH_ENTITY_next); it; (it = it._FOREACH_ENTITY_next, ++i)) \
{ \
LAMBDA(body) \
} \
void UncustomizeEntitiesRun()
{
- for (entity e = NULL; (e = findfloat(e, uncustomizeentityforclient_set, 1)); )
- WITH(entity, self, e, e.uncustomizeentityforclient());
+ FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, LAMBDA(
+ WITH(entity, self, it, it.uncustomizeentityforclient());
+ ));
}
STRING_ITERATOR(g_buf, string_null, 0);
void CreatureFrame_All()
{
- for(entity e = world; (e = findfloat(e, damagedbycontents, true)); )
- {
- if (e.movetype == MOVETYPE_NOCLIP) { continue; }
-
- CreatureFrame_Liquids(e);
- CreatureFrame_FallDamage(e);
-
- e.oldvelocity = e.velocity;
- }
+ FOREACH_ENTITY_FLOAT(damagedbycontents, true, LAMBDA(
+ if(it.movetype == MOVETYPE_NOCLIP) continue;
+ CreatureFrame_Liquids(it);
+ CreatureFrame_FallDamage(it);
+ it.oldvelocity = it.velocity;
+ ));
}
void Pause_TryPause(bool ispaused)
}
#endif
- for(entity e = world; (e = findfloat(e, csqcprojectile_clientanimate, 1)); )
- CSQCProjectile_Check(e);
+ FOREACH_ENTITY_FLOAT(csqcprojectile_clientanimate, true, LAMBDA(CSQCProjectile_Check(it)));
if(RedirectionThink())
return;