From 811844078e0f880cdd6d52465be6b55723e2305b Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 28 Jul 2016 22:08:53 +1000 Subject: [PATCH 1/1] Add an intrusive list for turrets --- qcsrc/common/turrets/sv_turrets.qc | 4 +++- qcsrc/server/defs.qh | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 71181f209..2c1895ff4 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -1199,7 +1199,8 @@ void turrets_manager_think(entity this) if (autocvar_g_turrets_reloadcvars == 1) { - FOREACH_ENTITY_FLAGS(turret_flags, TUR_FLAG_ISTURRET, { + IL_EACH(g_turrets, true, + { load_unit_settings(it, true); Turret tur = get_turretinfo(it.m_id); tur.tr_think(tur, it); @@ -1248,6 +1249,7 @@ bool turret_initialize(entity this, Turret tur) // if tur_head exists, we can assume this turret re-spawned if(!this.tur_head) { tur.tr_precache(tur); + IL_PUSH(g_turrets, this); } entity e = find(NULL, classname, "turret_manager"); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 3f6f392b6..ae1e70680 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -452,3 +452,6 @@ STATIC_INIT(g_waypoints) { g_waypoints = IL_NEW(); } IntrusiveList g_vehicles; STATIC_INIT(g_vehicles) { g_vehicles = IL_NEW(); } + +IntrusiveList g_turrets; +STATIC_INIT(g_turrets) { g_turrets = IL_NEW(); } -- 2.39.2