From: Mario Date: Mon, 17 Jul 2017 23:13:15 +0000 (+1000) Subject: Store rifle_accumulator on the weapon entity X-Git-Tag: xonotic-v0.8.5~2574 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d244e317bd326cbf8648a0a85adbf51fec1eedfb;p=xonotic%2Fxonotic-data.pk3dir.git Store rifle_accumulator on the weapon entity --- 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); } } }