From e077a11a53a49dbc84c10269863884d5406f0e9e Mon Sep 17 00:00:00 2001 From: Aranud Date: Mon, 13 Nov 2017 16:43:18 +0100 Subject: [PATCH] cgame: fix Sniper zoom is available even sniper isn't quipped, refs #1024 --- src/cgame/cg_weapons.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index dd4031cd6..e418445dc 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -3051,12 +3051,12 @@ void CG_AddPlayerWeapon(refEntity_t *parent, playerState_t *ps, centity_t *cent) CG_FlamethrowerFlame(cent, flash.origin); // make a dlight for the flash - if(!(muzzleContents & MASK_WATER)) + if (!(muzzleContents & MASK_WATER)) { if (weapon->flashDlightColor[0] != 0.f || weapon->flashDlightColor[1] != 0.f || weapon->flashDlightColor[2] != 0.f) { trap_R_AddLightToScene(flash.origin, 320, 1.25 + (rand() & 31) / 128.0f, weapon->flashDlightColor[0], - weapon->flashDlightColor[1], weapon->flashDlightColor[2], 0, 0); + weapon->flashDlightColor[1], weapon->flashDlightColor[2], 0, 0); } } } @@ -3901,10 +3901,10 @@ void CG_AltWeapon_f(void) if (cg.time - cg.weaponSelectTime < cg_weaponCycleDelay.integer) { return; // force pause so holding it down won't go too fast - } - // Don't try to switch when in the middle of reloading. - if (cg.snap->ps.weaponstate == WEAPON_RELOADING) + + // Don't try to switch when in the middle of reloading or firing. + if (cg.snap->ps.weaponstate == WEAPON_RELOADING || cg.snap->ps.weaponstate == WEAPON_FIRING) { return; }