X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ft_items.qc;h=7424d695aa041cf2eb557576d209df327ae60a77;hb=d1dda0cb9c4a3b21c5e5900a1ddafb4c9396161b;hp=ebc971141447e77c2a5a72ad18f11e05746b392b;hpb=c039d054a46888048d214000273ccfc63e4611b6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index ebc971141..7424d695a 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -18,7 +18,7 @@ #include "triggers/subs.qh" #include "util.qh" - #include + #include #include @@ -835,13 +835,12 @@ LABEL(pickup) if(this.team) { RandomSelection_Init(); - FOREACH_ENTITY_FLAGS(flags, FL_ITEM, + IL_EACH(g_items, it.team == this.team, { - if(it.team == this.team) - if(it.classname != "item_flag_team" && it.classname != "item_key_team") + if(it.classname != "item_flag_team" && it.classname != "item_kh_key") { Item_Show(it, -1); - RandomSelection_Add(it, 0, string_null, it.cnt, 0); + RandomSelection_AddEnt(it, it.cnt, 0); } }); e = RandomSelection_chosen_ent; @@ -880,21 +879,19 @@ void Item_FindTeam(entity this) // marker for item team search LOG_TRACE("Initializing item team ", ftos(this.team)); RandomSelection_Init(); - FOREACH_ENTITY_FLOAT(team, this.team, + IL_EACH(g_items, it.team == this.team, { - if(it.flags & FL_ITEM) - if(it.classname != "item_flag_team" && it.classname != "item_key_team") - RandomSelection_Add(it, 0, string_null, it.cnt, 0); + if(it.classname != "item_flag_team" && it.classname != "item_kh_key") + RandomSelection_AddEnt(it, it.cnt, 0); }); e = RandomSelection_chosen_ent; e.state = 0; Item_Show(e, 1); - FOREACH_ENTITY_FLOAT(team, this.team, + IL_EACH(g_items, it.team == this.team, { - if(it.flags & FL_ITEM) - if(it.classname != "item_flag_team" && it.classname != "item_key_team") + if(it.classname != "item_flag_team" && it.classname != "item_kh_key") { if(it != e) { @@ -1076,6 +1073,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default this.weapons = WepSet_FromWeapon(Weapons_from(weaponid)); this.flags = FL_ITEM | itemflags; + IL_PUSH(g_items, this); if(MUTATOR_CALLHOOK(FilterItem, this)) // error means we do not want the item { @@ -1447,10 +1445,9 @@ void target_items_use(entity this, entity actor, entity trigger) EXACTTRIGGER_TOUCH(this, trigger); } - FOREACH_ENTITY_ENT(enemy, actor, + IL_EACH(g_items, it.enemy == actor && it.classname == "droppedweapon", { - if(it.classname == "droppedweapon") - delete(it); + delete(it); }); if(GiveItems(actor, 0, tokenize_console(this.netname)))