if (mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH) {
this.move_qcphysics = false;
}
+ if(!IL_CONTAINS(g_moveables, this))
+ IL_PUSH(g_moveables, this); // add it to the moveable entities list (even if it doesn't move!) logic: if an object never sets its movetype, we assume it never does anything notable
this.movetype = (this.move_qcphysics) ? MOVETYPE_NONE : mt;
}
#elif defined(CSQC)
#pragma once
+IntrusiveList g_events;
+IntrusiveList g_components;
+STATIC_INIT(components) { g_events = IL_NEW(); g_components = IL_NEW(); }
+
/** Components always interpolate from the previous state */
#define COMPONENT(com) \
void com_##com##_interpolate(entity it, float a); \
.bool com_##com
-#define FOREACH_COMPONENT(com, body) FOREACH_ENTITY_FLOAT(com_##com, true, body)
+#define FOREACH_COMPONENT(com, body) IL_EACH(g_components, it.com_##com, body)
#define EVENT(T, args) .bool evt_##T##_listener; .void args evt_##T
#define emit(T, ...) \
MACRO_BEGIN \
- FOREACH_ENTITY_FLOAT_ORDERED(evt_##T##_listener, true, it.evt_##T(__VA_ARGS__)); \
+ IL_EACH(g_events, it.evt_##T##_listener, it.evt_##T(__VA_ARGS__)); \
MACRO_END
#define subscribe(listener, T, fn) \
MACRO_BEGIN \
listener.evt_##T = (fn); \
listener.evt_##T##_listener = true; \
+ IL_PUSH(g_events, listener); \
MACRO_END
IntrusiveList g_saved_team;
IntrusiveList g_monster_targets;
IntrusiveList g_pathlib_nodes;
+IntrusiveList g_moveables;
STATIC_INIT(defs)
{
g_monsters = IL_NEW();
g_saved_team = IL_NEW();
g_monster_targets = IL_NEW();
g_pathlib_nodes = IL_NEW();
+ g_moveables = IL_NEW();
}
if(autocvar_sv_freezenonclients)
return;
- FOREACH_ENTITY_FLOAT(pure_data, false,
+ IL_EACH(g_moveables, true,
{
if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS)
continue;
if(autocvar_sv_gameplayfix_delayprojectiles >= 0)
return;
- FOREACH_ENTITY_FLOAT(move_qcphysics, true,
+ IL_EACH(g_moveables, it.move_qcphysics,
{
if(IS_CLIENT(it) || is_pure(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE)
continue;