]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an intrusive list for turrets
authorMario <mario@smbclan.net>
Thu, 28 Jul 2016 12:08:53 +0000 (22:08 +1000)
committerMario <mario@smbclan.net>
Thu, 28 Jul 2016 12:08:53 +0000 (22:08 +1000)
qcsrc/common/turrets/sv_turrets.qc
qcsrc/server/defs.qh

index 71181f209eeed787652d166d2a9e0e1e345a425c..2c1895ff4410583a28ddf8c4f970ef96be9f3621 100644 (file)
@@ -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");
index 3f6f392b63046cc47edc6acec343d6e073184dad..ae1e7068090be6c129fc3221d196ca1e30c5aeba 100644 (file)
@@ -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(); }