From: Mario Date: Wed, 16 Nov 2016 23:34:06 +0000 (+1000) Subject: Use a trick to prevent handling of items that aren't registered with .itemdef (should... X-Git-Tag: xonotic-v0.8.2~435 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a8b1cd92c5071bca66242c7cc75c7756a28fbdc;p=xonotic%2Fxonotic-data.pk3dir.git Use a trick to prevent handling of items that aren't registered with .itemdef (should support any objective items, like flags and keys) --- diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 5587da593..e2647289b 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -826,7 +826,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink) if(player.buffs & BUFF_MAGNET.m_itemid) { vector pickup_size; - IL_EACH(g_items, it.classname != "item_flag_team" && it.classname != "item_kh_key", + IL_EACH(g_items, it.itemdef, { if(it.buffs) pickup_size = '1 1 1' * autocvar_g_buffs_magnet_range_buff; diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 724f3f9dd..46ee92d90 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -838,7 +838,7 @@ LABEL(pickup) RandomSelection_Init(); IL_EACH(g_items, it.team == this.team, { - if(it.classname != "item_flag_team" && it.classname != "item_kh_key") + if(it.itemdef) // is a registered item { Item_Show(it, -1); RandomSelection_AddEnt(it, it.cnt, 0); @@ -882,7 +882,7 @@ void Item_FindTeam(entity this) RandomSelection_Init(); IL_EACH(g_items, it.team == this.team, { - if(it.classname != "item_flag_team" && it.classname != "item_kh_key") + if(it.itemdef) // is a registered item RandomSelection_AddEnt(it, it.cnt, 0); }); @@ -892,7 +892,7 @@ void Item_FindTeam(entity this) IL_EACH(g_items, it.team == this.team, { - if(it.classname != "item_flag_team" && it.classname != "item_kh_key") + if(it.itemdef) // is a registered item { if(it != e) {