]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc
Merge branch 'DefaultUser/m_itemid' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / melee_only / sv_melee_only.qc
index f418395590ed0bae36e0953d64ae48cb709bc739..a542921221a6a37bc7bddf4bb485f26fdcbd8d08 100644 (file)
@@ -2,12 +2,18 @@
 
 REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !cvar("g_overkill") && !g_nexball);
 
-MUTATOR_HOOKFUNCTION(melee_only, SetStartItems)
+MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST)
 {
        start_ammo_shells = warmup_start_ammo_shells = 0;
        start_weapons = warmup_start_weapons = WEPSET(SHOTGUN);
 }
 
+MUTATOR_HOOKFUNCTION(melee_only, SetWeaponArena)
+{
+       // turn weapon arena off
+       M_ARGV(0, string) = "off";
+}
+
 MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
 {
        return true;
@@ -17,10 +23,10 @@ MUTATOR_HOOKFUNCTION(melee_only, FilterItem)
 {
        entity item = M_ARGV(0, entity);
 
-       switch (item.items)
+       switch (item.itemdef)
        {
-               case ITEM_HealthSmall.m_itemid:
-               case ITEM_ArmorSmall.m_itemid:
+               case ITEM_HealthSmall:
+               case ITEM_ArmorSmall:
                        return false;
        }