]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an intrusive list for entities that save their team, and don't loop through pure...
authorMario <mario@smbclan.net>
Sat, 20 May 2017 10:28:51 +0000 (20:28 +1000)
committerMario <mario@smbclan.net>
Sat, 20 May 2017 10:28:51 +0000 (20:28 +1000)
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/triggers/trigger/relay_teamcheck.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/spawnpoints.qc

index f09e21fdbeeda068ddeea608219adfa84e13973e..5525c4d6a8f5d72e24acda5f2f96aae1b45b899a 100644 (file)
@@ -1039,6 +1039,7 @@ void ons_GeneratorSetup(entity gen) // called when spawning a generator entity o
        gen.classname = "onslaught_generator";
        gen.solid = SOLID_BBOX;
        gen.team_saved = teamnumber;
+       IL_PUSH(g_saved_team, gen);
        set_movetype(gen, MOVETYPE_NONE);
        gen.lasthealth = gen.max_health = gen.health = autocvar_g_onslaught_gen_health;
        gen.takedamage = DAMAGE_AIM;
index dc2e6f7dc0a062a2a19e8c2a611ee12b8cb14ea2..81a61019080174099569de31bfb87670605c3ea1 100644 (file)
@@ -353,6 +353,7 @@ spawnfunc(func_breakable)
                precache_sound(this.noise1);
 
        this.team_saved = this.team;
+       IL_PUSH(g_saved_team, this);
        this.dropped_origin = this.origin;
 
        this.reset = func_breakable_reset;
index 7aa13c13ebfc2aec22b8d7a7382607877cd0d5e2..8f7305d6f88c49236397721a14a0f5813087ab45 100644 (file)
@@ -164,6 +164,7 @@ spawnfunc(trigger_multiple)
        EXACTTRIGGER_INIT;
 
        this.team_saved = this.team;
+       IL_PUSH(g_saved_team, this);
 
        if (this.health)
        {
index 4f9dab7fd1e500a4228297b82ba9e6dab1be6dc6..fee28df51af0842986aeed926ee23aad1744f933 100644 (file)
@@ -30,6 +30,7 @@ void trigger_relay_teamcheck_reset(entity this)
 spawnfunc(trigger_relay_teamcheck)
 {
        this.team_saved = this.team;
+       IL_PUSH(g_saved_team, this);
        this.use = trigger_relay_teamcheck_use;
        this.reset = trigger_relay_teamcheck_reset;
 }
index b6f38ed32b4632074828079c82b8cf07407058b4..8d1763b73c49be40c510cc4ee3d9a136a1e6d7cc 100644 (file)
@@ -344,7 +344,10 @@ void reset_map(bool dorespawn)
 
        MUTATOR_CALLHOOK(reset_map_global);
 
-       FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), {
+       FOREACH_ENTITY_FLOAT(pure_data, false,
+       {
+               if(IS_CLIENT(it))
+                       continue;
                if (it.reset)
                {
                        it.reset(it);
index c8e5f6263225f754d77f88bd28672b1b243f2da9..11b915027c8b2deb3029a2370013a86d00ac05fe 100644 (file)
@@ -476,3 +476,6 @@ STATIC_INIT(g_ladders) { g_ladders = IL_NEW(); }
 
 IntrusiveList g_locations;
 STATIC_INIT(g_locations) { g_locations = IL_NEW(); }
+
+IntrusiveList g_saved_team;
+STATIC_INIT(g_saved_team) { g_saved_team = IL_NEW(); }
index 994a29719c810a16d0029c18328269f1609ff31c..350dc5d68f6b13f3ddc1fbc72d6ffe7ae3ea297d 100644 (file)
@@ -195,13 +195,12 @@ void assault_new_round(entity this)
        else
                assault_attacker_team = NUM_TEAM_1;
 
-       FOREACH_ENTITY_FLOAT(pure_data, false,
+       IL_EACH(g_saved_team, !IS_CLIENT(it),
        {
-               if(IS_CLIENT(it))
-                       continue;
-
-               if (it.team_saved == NUM_TEAM_1) it.team_saved = NUM_TEAM_2;
-               else if (it.team_saved == NUM_TEAM_2) it.team_saved = NUM_TEAM_1;
+               if(it.team_saved == NUM_TEAM_1)
+                       it.team_saved = NUM_TEAM_2;
+               else if(it.team_saved == NUM_TEAM_2)
+                       it.team_saved = NUM_TEAM_1;
        });
 
        // reset the level with a countdown
index 84819efbe1c6b51f407c9e9e9b509dcd82aab441..3d62c149cf9996c74454ea0c0e27c04c9ad6648a 100644 (file)
@@ -106,6 +106,7 @@ void relocate_spawnpoint(entity this)
     setthink(this, spawnpoint_think);
     this.nextthink = time + 0.5 + random() * 2; // shouldn't need it for a little second
     this.team_saved = this.team;
+    IL_PUSH(g_saved_team, this);
     if (!this.cnt)
         this.cnt = 1;