From 8a8b1cd92c5071bca66242c7cc75c7756a28fbdc Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 17 Nov 2016 09:34:06 +1000 Subject: [PATCH] Use a trick to prevent handling of items that aren't registered with .itemdef (should support any objective items, like flags and keys) --- qcsrc/common/mutators/mutator/buffs/sv_buffs.qc | 2 +- qcsrc/common/t_items.qc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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) { -- 2.39.2