]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nix/sv_nix.qc
Merge branch 'master' into Mario/wepent_experimental
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nix / sv_nix.qc
index 24fa435b4c021dd5d8365cb815c8faccd6152c25..fb995a10a44543d730a57c02aff14993bedf2c4f 100644 (file)
@@ -102,7 +102,7 @@ void NIX_ChooseNextWeapon()
        RandomSelection_Init();
        FOREACH(Weapons, it != WEP_Null, LAMBDA(
                if(NIX_CanChooseWeapon(it.m_id))
-                       RandomSelection_Add(NULL, it.m_id, string_null, 1, (it.m_id != nix_weapon));
+                       RandomSelection_AddFloat(it.m_id, 1, (it.m_id != nix_weapon));
        ));
        nix_nextweapon = RandomSelection_chosen_float;
 }
@@ -255,24 +255,13 @@ MUTATOR_HOOKFUNCTION(nix, FilterItem)
 {
        entity item = M_ARGV(0, entity);
 
-       switch (item.items)
+       if(item.itemdef.instanceOfHealth || item.itemdef.instanceOfArmor)
        {
-               case ITEM_HealthSmall.m_itemid:
-               case ITEM_HealthMedium.m_itemid:
-               case ITEM_HealthLarge.m_itemid:
-               case ITEM_HealthMega.m_itemid:
-               case ITEM_ArmorSmall.m_itemid:
-               case ITEM_ArmorMedium.m_itemid:
-               case ITEM_ArmorLarge.m_itemid:
-               case ITEM_ArmorMega.m_itemid:
-                       if (autocvar_g_nix_with_healtharmor)
-                               return false;
-                       break;
-               case ITEM_Strength.m_itemid:
-               case ITEM_Shield.m_itemid:
-                       if (autocvar_g_nix_with_powerups)
-                               return false;
-                       break;
+               return !autocvar_g_nix_with_healtharmor;
+       }
+       else if(item.itemdef.instanceOfPowerup)
+       {
+               return !autocvar_g_nix_with_powerups;
        }
 
        return true; // delete all other items
@@ -290,7 +279,7 @@ MUTATOR_HOOKFUNCTION(nix, PlayerPreThink)
 {
        entity player = M_ARGV(0, entity);
 
-       if(!intermission_running)
+       if(!gameover)
        if(!IS_DEAD(player))
        if(IS_PLAYER(player))
                NIX_GiveCurrentWeapon(player);