]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
Merge branch 'terencehill/less_entities'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / overkill / sv_overkill.qc
index b6ff5e14d37fdf83e2d82e915ef36b0fe830b067..1ab45eb284cc8e2256fb41f7ceb1efad5cf23741 100644 (file)
@@ -1,22 +1,15 @@
 #include "sv_overkill.qh"
 
+#include "okshotgun.qh"
+#include "okhmg.qh"
+#include "okrpc.qh"
+
 bool autocvar_g_overkill_powerups_replace;
 
 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.
@@ -77,7 +70,6 @@ MUTATOR_HOOKFUNCTION(ok, Damage_Calculate, CBC_ORDER_LAST)
                if(!STAT(FROZEN, frag_target))
                if(!IS_DEAD(frag_target))
                {
-                       Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_SECONDARY_NODAMAGE);
                        M_ARGV(6, vector) = '0 0 0'; // force
                }
 
@@ -98,7 +90,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);
 
@@ -139,7 +131,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;
@@ -270,7 +262,10 @@ MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
        if(WEP_OVERKILL_RPC.weaponstart > 0) { ok_start_items |= WEPSET(OVERKILL_RPC); }
        if(WEP_OVERKILL_HMG.weaponstart > 0) { ok_start_items |= WEPSET(OVERKILL_HMG); }
 
-       start_items |= IT_UNLIMITED_WEAPON_AMMO;
+       // this gives unlimited ammo (the 4 types) but not fuel
+       // using `g_use_ammunition` instead gives also fuel which is unnecessary and distracting in the HUD
+       start_items |= IT_UNLIMITED_AMMO;
+
        start_weapons = warmup_start_weapons = ok_start_items;
 }