#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>
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(); }
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)
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);