From: Mario Date: Sun, 21 Aug 2016 16:32:43 +0000 (+1000) Subject: Add another intrusive list and hopefully fix compilation unit X-Git-Tag: xonotic-v0.8.2~663^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b608d8748001bb8f700e064a6f59a1ebda94e5d5;p=xonotic%2Fxonotic-data.pk3dir.git Add another intrusive list and hopefully fix compilation unit --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 577f4074e..78a1f745d 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 568084045..447d4a8ea 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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(); } diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index dfe4281b2..f4566a9ca 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -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);