]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add another intrusive list and hopefully fix compilation unit
authorMario <mario@smbclan.net>
Sun, 21 Aug 2016 16:32:43 +0000 (02:32 +1000)
committerMario <mario@smbclan.net>
Sun, 21 Aug 2016 16:32:43 +0000 (02:32 +1000)
qcsrc/server/bot/default/havocbot/havocbot.qc
qcsrc/server/defs.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc

index 577f4074e25747bae4a4d4afa56050d7a5d47ed2..78a1f745d9e8d681e06a5db6f51ebba53c0639ef 100644 (file)
@@ -13,6 +13,7 @@
 #include <common/state.qh>
 #include <common/items/_mod.qh>
 
+#include <common/triggers/teleporters.qh>
 #include <common/triggers/trigger/jumppads.qh>
 
 #include <lib/warpzone/common.qh>
index 5680840456fb8e333c1087442a384ec4b38df1b9..447d4a8ea88aa0bb7ebd119930c7bdcdf02a07b5 100644 (file)
@@ -461,5 +461,8 @@ STATIC_INIT(g_assault_destructibles) { g_assault_destructibles = IL_NEW(); }
 IntrusiveList g_assault_objectivedecreasers;
 STATIC_INIT(g_assault_objectivedecreasers) { g_assault_objectivedecreasers = IL_NEW(); }
 
+IntrusiveList g_assault_objectives;
+STATIC_INIT(g_assault_objectives) { g_assault_objectives = IL_NEW(); }
+
 IntrusiveList g_spawnpoints;
 STATIC_INIT(g_spawnpoints) { g_spawnpoints = IL_NEW(); }
index dfe4281b23c826ae818c9c3ff075b94f0300fdea..f4566a9ca667b305a759e05fcf96edf9dc7c6e4c 100644 (file)
@@ -71,16 +71,13 @@ void assault_objective_decrease_use(entity this, entity actor, entity trigger)
 
 void assault_setenemytoobjective(entity this)
 {
-       FOREACH_ENTITY_STRING(targetname, this.target,
+       IL_EACH(g_assault_objectives, it.targetname == this.target,
        {
-               if(it.classname == "target_objective")
-               {
-                       if(this.enemy == NULL)
-                               this.enemy = it;
-                       else
-                               objerror(this, "more than one objective as target - fix the map!");
-                       break;
-               }
+               if(this.enemy == NULL)
+                       this.enemy = it;
+               else
+                       objerror(this, "more than one objective as target - fix the map!");
+               break;
        });
 
        if(this.enemy == NULL)
@@ -284,6 +281,7 @@ spawnfunc(target_objective)
        if (!g_assault) { delete(this); return; }
 
        this.classname = "target_objective";
+       IL_PUSH(g_assault_objectives, this);
        this.use = assault_objective_use;
        this.reset = assault_objective_reset;
        this.reset(this);