Use a trick to prevent handling of items that aren't registered with .itemdef (should...
authorMario <mario@smbclan.net>
Wed, 16 Nov 2016 23:34:06 +0000 (09:34 +1000)
committerMario <mario@smbclan.net>
Wed, 16 Nov 2016 23:34:06 +0000 (09:34 +1000)
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/t_items.qc

index 5587da593796e32e6e6afee3d91d84ec4ac14a18..e2647289b75672c608da0a42b9dabf804a7b086c 100644 (file)
@@ -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;
index 724f3f9ddb07be217742d432f6caccb0aa46d9c7..46ee92d906e93cc8dc3a5c30de4750a8f7061a09 100644 (file)
@@ -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)
                                {