]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/hmg.qc
Offhand: fix machinegun (still needs .clip_load > 0)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hmg.qc
index 8e5398745f5eeb8c5227c942d3c5501a8e61608c..5e48c2840999f6f814349ab64d7678bd523bc584 100644 (file)
@@ -45,11 +45,11 @@ HMG_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 
 void spawnfunc_weapon_hmg() { weapon_defaultspawnfunc(WEP_HMG.m_id); }
 
-void W_HeavyMachineGun_Attack_Auto()
+void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, bool fire1, bool fire2)
 {SELFPARAM();
        if (!self.BUTTON_ATCK)
        {
-               w_ready();
+               w_ready(thiswep, fire1, fire2);
                return;
        }
 
@@ -57,11 +57,11 @@ void W_HeavyMachineGun_Attack_Auto()
        if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                W_SwitchWeapon_Force(self, w_getbestweapon(self));
-               w_ready();
+               w_ready(thiswep, fire1, fire2);
                return;
        }
 
-       W_DecreaseAmmo(WEP_CVAR(hmg, ammo));
+       W_DecreaseAmmo(WEP_HMG, WEP_CVAR(hmg, ammo));
 
        W_SetupShot (self, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(hmg, damage));
 
@@ -97,17 +97,17 @@ void W_HeavyMachineGun_Attack_Auto()
 
                        return true;
                }
-               METHOD(HeavyMachineGun, wr_think, bool(entity thiswep))
+               METHOD(HeavyMachineGun, wr_think, bool(entity thiswep, bool fire1, bool fire2))
                {
                        if(WEP_CVAR(hmg, reload_ammo) && self.clip_load < WEP_CVAR(hmg, ammo)) // forced reload
                                _WEP_ACTION(self.weapon, WR_RELOAD);
                        else
                        {
-                               if (self.BUTTON_ATCK)
+                               if (fire1)
                                if (weapon_prepareattack(0, 0))
                                {
                                        self.misc_bulletcounter = 0;
-                                       W_HeavyMachineGun_Attack_Auto();
+                                       W_HeavyMachineGun_Attack_Auto(thiswep, fire1, fire2);
                                }
                        }