]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
Use a trick to prevent handling of items that aren't registered with .itemdef (should...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / buffs / sv_buffs.qc
index 82fa2d33cb8bd0e0a649619e7836f95eefdfd9d6..e2647289b75672c608da0a42b9dabf804a7b086c 100644 (file)
@@ -216,7 +216,7 @@ void buff_NewType(entity ent, float cb)
        FOREACH(Buffs, buff_Available(it), LAMBDA(
                it.buff_seencount += 1;
                // if it's already been chosen, give it a lower priority
-               RandomSelection_Add(NULL, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount));
+               RandomSelection_AddFloat(it.m_itemid, 1, max(0.2, 1 / it.buff_seencount));
        ));
        ent.buffs = RandomSelection_chosen_float;
 }
@@ -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;