From: David Knapp Date: Thu, 4 Jul 2019 10:44:20 +0000 (-0400) Subject: Fix regression where entire mag would be dumped if reloaded mid-burst. X-Git-Tag: xonotic-v0.8.5~1287^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=caf6634640e9498aac0ce8633039aec94e7d22c2;p=xonotic%2Fxonotic-data.pk3dir.git Fix regression where entire mag would be dumped if reloaded mid-burst. --- 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;