X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Frifle.qc;h=b96fa35831c0095baf37399663968e4e75e7597f;hp=0e49171122634db1b0aaecce386dd1ccc984914d;hb=bc3f297ed082b23fb33dd0d8f5dcd33bb0198507;hpb=700861789922294ffa4b654a6683be45993240d1 diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index 0e4917112..b96fa3583 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -8,7 +8,7 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo W_DecreaseAmmo(thiswep, actor, pAmmo, weaponentity); - W_SetupShot(actor, weaponentity, true, 2, pSound, CH_WEAPON_A, pDamage * pShots); + W_SetupShot(actor, weaponentity, true, 2, pSound, CH_WEAPON_A, pDamage * pShots, deathtype); Send_Effect(EFFECT_RIFLE_MUZZLEFLASH, w_shotorg, w_shotdir * 2000, 1); @@ -19,7 +19,7 @@ void W_Rifle_FireBullet(Weapon thiswep, .entity weaponentity, float pSpread, flo } for(i = 0; i < pShots; ++i) - fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE)); + fireBullet(actor, weaponentity, w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK)); if(autocvar_g_casings >= 2) { @@ -159,7 +159,11 @@ METHOD(Rifle, wr_checkammo2, bool(entity thiswep, entity actor, .entity weaponen } METHOD(Rifle, wr_resetplayer, void(entity thiswep, entity actor)) { - actor.rifle_accumulator = time - WEP_CVAR(rifle, bursttime); + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + actor.(weaponentity).rifle_accumulator = time - WEP_CVAR(rifle, bursttime); + } } METHOD(Rifle, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { @@ -223,5 +227,9 @@ METHOD(Rifle, wr_zoom, bool(entity thiswep, entity actor)) return false; } } +METHOD(Rifle, wr_zoomdir, bool(entity thiswep)) +{ + return button_attack2 && !WEP_CVAR(rifle, secondary); +} #endif