From 06ab161ccc7a263edcf926776c8482b961b21522 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 3 Aug 2016 11:36:37 +1000 Subject: [PATCH] Only spawn a single casing when firing shotgun --- qcsrc/common/weapons/weapon/shotgun.qc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index f89ef6872..46af2abc8 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -60,13 +60,10 @@ spawnfunc(weapon_shotgun) { weapon_defaultspawnfunc(this, WEP_SHOTGUN); } void W_Shotgun_Attack(Weapon thiswep, entity actor, float isprimary) { - float sc; - entity flash; - W_DecreaseAmmo(thiswep, actor, WEP_CVAR_PRI(shotgun, ammo)); W_SetupShot(actor, true, 5, SND_SHOTGUN_FIRE, ((isprimary) ? CH_WEAPON_A : CH_WEAPON_SINGLE), WEP_CVAR_PRI(shotgun, damage) * WEP_CVAR_PRI(shotgun, bullets)); - for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1) + for(int sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1) fireBullet(actor, w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN.m_id, 0); Send_Effect(EFFECT_SHOTGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo)); @@ -75,12 +72,12 @@ void W_Shotgun_Attack(Weapon thiswep, entity actor, float isprimary) if(autocvar_g_casings >= 1) { makevectors(actor.v_angle); // for some reason, this is lost - for(sc = 0;sc < WEP_CVAR_PRI(shotgun, ammo);sc = sc + 1) + //for(int sc = 0;sc < WEP_CVAR_PRI(shotgun, ammo);sc = sc + 1) SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1, actor); } // muzzle flash for 1st person view - flash = spawn(); + entity flash = spawn(); setmodel(flash, MDL_SHOTGUN_MUZZLEFLASH); // precision set below setthink(flash, SUB_Remove); flash.nextthink = time + 0.06; -- 2.39.2