From 55572a7bad47f9f4b7c75a93e2b621049a248e84 Mon Sep 17 00:00:00 2001 From: kadaverjack Date: Tue, 19 Sep 2006 05:37:26 +0000 Subject: [PATCH] setattachment() for uzi muzzle flash... it's currently only visible for the 1st person view, in 3rd person it was way to small and the position was wrong. (perhaps that could be fixed with a second flash, attached to the exterior weapon model) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1888 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/ctf.qc | 2 -- data/qcsrc/server/w_uzi.qc | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/data/qcsrc/server/ctf.qc b/data/qcsrc/server/ctf.qc index d1a88da37..4661fc993 100644 --- a/data/qcsrc/server/ctf.qc +++ b/data/qcsrc/server/ctf.qc @@ -125,8 +125,6 @@ void AnimateFlag() void() FlagThink = { local entity e; - local vector v; - local float f; self.nextthink = time + 0.1; diff --git a/data/qcsrc/server/w_uzi.qc b/data/qcsrc/server/w_uzi.qc index 7b141a1e1..7fbc4662a 100644 --- a/data/qcsrc/server/w_uzi.qc +++ b/data/qcsrc/server/w_uzi.qc @@ -1,5 +1,7 @@ .float uzi_bulletcounter; +float() FlashCustomize = { return other == self.owner; }; + void W_Uzi_Attack (void) { local entity flash; @@ -26,15 +28,18 @@ void W_Uzi_Attack (void) else fireBullet (w_shotorg, w_shotdir, cvar("g_balance_uzi_sustained_spread"), cvar("g_balance_uzi_sustained_damage"), IT_UZI, (self.uzi_bulletcounter & 3) == 0); - flash = spawn (); - setorigin (flash, w_shotorg + v_forward * 17); - setmodel (flash, "models/uziflash.md3"); - flash.angles = vectoangles (w_shotdir); - flash.angles_z=flash.v_angle_z + random () * 180; - flash.scale = 0.75; + + flash = spawn(); + setorigin(flash, '53 5 0'); + setmodel(flash, "models/uziflash.md3"); + setattachment(flash, self.weaponentity, "bone01"); + flash.owner = self; + flash.customizeentityforclient = FlashCustomize; + flash.angles_z = flash.v_angle_z + random() * 180; + flash.scale = 1.2; flash.alpha = 0.5; - SUB_SetFade (flash, time, 0.2); - flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; + SUB_SetFade(flash, time, 0.2); + flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; // casing code if (cvar("g_casings") >= 2) -- 2.39.2