]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix regression where entire mag would be dumped if reloaded mid-burst.
authorDavid Knapp <mazecraze96@gmail.com>
Thu, 4 Jul 2019 10:44:20 +0000 (06:44 -0400)
committerDavid Knapp <mazecraze96@gmail.com>
Thu, 4 Jul 2019 10:48:50 +0000 (06:48 -0400)
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/server/weapons/weaponsystem.qc

index ea96a8f59979a09547eb74b6fdde42f24680c0cc..2333d860d65f7330580932e996a334fcb6cb0f5d 100644 (file)
@@ -283,7 +283,7 @@ 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))
-{
+{   
     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 b75881127a219008f56faaad9d086817d922ab4c..736f21fbd1681a041888486008ebdaf133683735 100644 (file)
@@ -808,7 +808,9 @@ 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;