From b608d8748001bb8f700e064a6f59a1ebda94e5d5 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 22 Aug 2016 02:32:43 +1000 Subject: [PATCH] Add another intrusive list and hopefully fix compilation unit --- qcsrc/server/bot/default/havocbot/havocbot.qc | 1 + qcsrc/server/defs.qh | 3 +++ .../server/mutators/mutator/gamemode_assault.qc | 16 +++++++--------- 3 files changed, 11 insertions(+), 9 deletions(-) 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); -- 2.39.2