From 80a63806002ad329c7b6c3a37f1b4ec527483d32 Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 1 May 2008 18:26:51 +0000 Subject: [PATCH] fix code bug that may cause Yoda to "remove" the Nex beam, and that may cause the Nex beam end explosion to randomly not appear. May or may not fix the issue Green reported. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3605 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/w_common.qc | 7 ++++++- data/qcsrc/server/w_nex.qc | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/qcsrc/server/w_common.qc b/data/qcsrc/server/w_common.qc index 2085f3065..0f6514352 100644 --- a/data/qcsrc/server/w_common.qc +++ b/data/qcsrc/server/w_common.qc @@ -25,7 +25,8 @@ void W_GiveWeapon (entity e, float wep, string name) void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float deathtype) { local vector hitloc, force, endpoint, dir; - local entity ent; + local entity ent, endent; + local float endq3surfaceflags; //local entity explosion; dir = normalize(end - start); @@ -62,6 +63,8 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f } endpoint = trace_endpos; + endent = trace_ent; + endq3surfaceflags = trace_dphitq3surfaceflags; // find all the entities the railgun hit and restore their solid state ent = findfloat(world, railgunhit, TRUE); @@ -101,6 +104,8 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f //remove(explosion); trace_endpos = endpoint; + trace_ent = endent; + trace_dphitq3surfaceflags = endq3surfaceflags; } void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer) diff --git a/data/qcsrc/server/w_nex.qc b/data/qcsrc/server/w_nex.qc index 3c10e8030..bc5ff31a6 100644 --- a/data/qcsrc/server/w_nex.qc +++ b/data/qcsrc/server/w_nex.qc @@ -1,6 +1,10 @@ void W_Nex_Attack (void) { + float flying; + if not(g_minstagib || g_instagib) + flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last + W_SetupShot (self, '25 4 -4', TRUE, 5, "weapons/nexfire.wav"); //W_SetupShot (self, '25 8 -8', TRUE, 2, "weapons/nexfire.wav"); // TODO: move model down a little @@ -11,8 +15,9 @@ void W_Nex_Attack (void) { yoda = 0; FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), IT_NEX); + if(yoda) - if(IsFlying(self)) + if(flying) announce(self, "announcer/male/yoda.ogg"); } -- 2.39.2