From d244e317bd326cbf8648a0a85adbf51fec1eedfb Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 18 Jul 2017 09:13:15 +1000 Subject: [PATCH] Store rifle_accumulator on the weapon entity --- qcsrc/common/weapons/weapon/rifle.qc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index d75b1fe8d..771f38436 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -172,14 +172,14 @@ METHOD(Rifle, wr_think, void(entity thiswep, entity actor, .entity weaponentity, thiswep.wr_reload(thiswep, actor, weaponentity); } else { - actor.rifle_accumulator = bound(time - WEP_CVAR(rifle, bursttime), actor.rifle_accumulator, time); + actor.(weaponentity).rifle_accumulator = bound(time - WEP_CVAR(rifle, bursttime), actor.(weaponentity).rifle_accumulator, time); if(fire & 1) if(weapon_prepareattack_check(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(rifle, refire))) - if(time >= actor.rifle_accumulator + WEP_CVAR_PRI(rifle, burstcost)) + if(time >= actor.(weaponentity).rifle_accumulator + WEP_CVAR_PRI(rifle, burstcost)) { weapon_prepareattack_do(actor, weaponentity, false, WEP_CVAR_PRI(rifle, refire)); W_Rifle_BulletHail(actor, weaponentity, WEP_CVAR_PRI(rifle, bullethail), W_Rifle_Attack, WFRAME_FIRE1, WEP_CVAR_PRI(rifle, animtime), WEP_CVAR_PRI(rifle, refire)); - actor.rifle_accumulator += WEP_CVAR_PRI(rifle, burstcost); + actor.(weaponentity).rifle_accumulator += WEP_CVAR_PRI(rifle, burstcost); } if(fire & 2) { @@ -190,11 +190,11 @@ METHOD(Rifle, wr_think, void(entity thiswep, entity actor, .entity weaponentity, } else { if(weapon_prepareattack_check(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(rifle, refire))) - if(time >= actor.rifle_accumulator + WEP_CVAR_SEC(rifle, burstcost)) + if(time >= actor.(weaponentity).rifle_accumulator + WEP_CVAR_SEC(rifle, burstcost)) { weapon_prepareattack_do(actor, weaponentity, true, WEP_CVAR_SEC(rifle, refire)); W_Rifle_BulletHail(actor, weaponentity, WEP_CVAR_SEC(rifle, bullethail), W_Rifle_Attack2, WFRAME_FIRE2, WEP_CVAR_SEC(rifle, animtime), WEP_CVAR_PRI(rifle, refire)); - actor.rifle_accumulator += WEP_CVAR_SEC(rifle, burstcost); + actor.(weaponentity).rifle_accumulator += WEP_CVAR_SEC(rifle, burstcost); } } } -- 2.39.2