]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
Don't spawn by default some useless entities of game modes and mutators
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / overkill / sv_overkill.qc
index 9fa66e8b2a18c12523da72e4c45820d0c711fe7e..993afcdd4d5c2ae60ed5108004f3a950054f306c 100644 (file)
@@ -10,17 +10,6 @@ bool autocvar_g_overkill_itemwaypoints = true;
 
 .Weapon ok_lastwep[MAX_WEAPONSLOTS];
 
-IntrusiveList g_overkill_items;
-STATIC_INIT()
-{
-       g_overkill_items = IL_NEW();
-       IL_PUSH(g_overkill_items, ITEM_HealthMega);
-       IL_PUSH(g_overkill_items, ITEM_ArmorSmall);
-       IL_PUSH(g_overkill_items, ITEM_ArmorMedium);
-       IL_PUSH(g_overkill_items, ITEM_ArmorBig);
-       IL_PUSH(g_overkill_items, ITEM_ArmorMega);
-}
-
 /// \brief Returns a random classname of the overkill item.
 /// \param[in] prefix Prefix of the cvars that hold probabilities.
 /// \return Random classname of the overkill item.
@@ -102,7 +91,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDies)
        entity frag_attacker = M_ARGV(1, entity);
        entity frag_target = M_ARGV(2, entity);
 
-       entity targ = ((frag_attacker) ? frag_attacker : frag_target);
+       entity targ = ((IS_PLAYER(frag_attacker)) ? frag_attacker : frag_target);
 
        ok_DropItem(frag_target, targ);
 
@@ -143,7 +132,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
        {
                return;
        }
-       if (!PHYS_INPUT_BUTTON_ATCK2(player) || forbidWeaponUse(player) ||
+       if (!PHYS_INPUT_BUTTON_ATCK2(player) || weaponLocked(player) ||
                !(round_handler_IsActive() && !round_handler_IsRoundStarted()))
        {
                return;