]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Block manual reload if bursting to avoid wasting ammo.
authorDavid Knapp <mazecraze96@gmail.com>
Fri, 5 Jul 2019 03:43:56 +0000 (23:43 -0400)
committerDavid Knapp <mazecraze96@gmail.com>
Fri, 5 Jul 2019 03:43:56 +0000 (23:43 -0400)
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/server/weapons/weaponsystem.qc

index 2333d860d65f7330580932e996a334fcb6cb0f5d..04f20e0c206d53a79a89551d872f1018d9dfa3a4 100644 (file)
@@ -283,7 +283,9 @@ METHOD(MachineGun, wr_checkammo2, bool(entity thiswep, entity actor, .entity wea
     return ammo_amount;
 }
 METHOD(MachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
-{   
+{
+       if(actor.(weaponentity).misc_bulletcounter < 0)
+               return;
     W_Reload(actor, weaponentity, min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND_RELOAD);
 }
 METHOD(MachineGun, wr_suicidemessage, Notification(entity thiswep))
index 736f21fbd1681a041888486008ebdaf133683735..d367b72ad2e22ecaef25ef78c44530f7b2fbee54 100644 (file)
@@ -809,8 +809,6 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen
                }
        }
        
-       actor.(weaponentity).misc_bulletcounter = 0;
-       
        if (this)
        {
                if (this.wframe == WFRAME_RELOAD) return;