From caf6634640e9498aac0ce8633039aec94e7d22c2 Mon Sep 17 00:00:00 2001 From: David Knapp Date: Thu, 4 Jul 2019 06:44:20 -0400 Subject: [PATCH] Fix regression where entire mag would be dumped if reloaded mid-burst. --- qcsrc/common/weapons/weapon/machinegun.qc | 2 +- qcsrc/server/weapons/weaponsystem.qc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index ea96a8f59..2333d860d 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -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)) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index b75881127..736f21fbd 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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; -- 2.39.2