From: David Knapp Date: Fri, 5 Jul 2019 03:43:56 +0000 (-0400) Subject: Block manual reload if bursting to avoid wasting ammo. X-Git-Tag: xonotic-v0.8.5~1287^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a22adaa8d34e90ff345aa85b1ef6efcc1b670c56;p=xonotic%2Fxonotic-data.pk3dir.git Block manual reload if bursting to avoid wasting ammo. --- diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index 2333d860d..04f20e0c2 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -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)) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 736f21fbd..d367b72ad 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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;