From: Mario Date: Thu, 28 Jul 2016 12:08:53 +0000 (+1000) Subject: Add an intrusive list for turrets X-Git-Tag: xonotic-v0.8.2~752^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=811844078e0f880cdd6d52465be6b55723e2305b;p=xonotic%2Fxonotic-data.pk3dir.git Add an intrusive list for turrets --- 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(); }