Check misc_bulletcounter == 0 before reloading machine gun to let burst finish
authorDavid Knapp <mazecraze96@gmail.com>
Thu, 4 Jul 2019 08:07:15 +0000 (04:07 -0400)
committerDavid Knapp <mazecraze96@gmail.com>
Thu, 4 Jul 2019 10:48:50 +0000 (06:48 -0400)
qcsrc/common/weapons/weapon/machinegun.qc

index 6679f2135fe2079904ec6f920a911eb2758556b1..ea96a8f59979a09547eb74b6fdde42f24680c0cc 100644 (file)
@@ -199,7 +199,7 @@ METHOD(MachineGun, wr_aim, void(entity thiswep, entity actor, .entity weaponenti
 }
 METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
-    if(WEP_CVAR(machinegun, reload_ammo) && actor.(weaponentity).clip_load < min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo))) { // forced reload
+    if(WEP_CVAR(machinegun, reload_ammo) && actor.(weaponentity).clip_load < min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)) && actor.(weaponentity).misc_bulletcounter >= 0) { // forced reload - wait until the bulletcounter is 0 so a burst loop can finish
         thiswep.wr_reload(thiswep, actor, weaponentity);
     } else
     if(WEP_CVAR(machinegun, mode) == 1)