r3278 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 26 04:54:11 EST 2008


Author: div0
Date: 2008-01-26 04:53:47 -0500 (Sat, 26 Jan 2008)
New Revision: 3278

Modified:
   trunk/data/qcsrc/server/cl_weaponsystem.qc
Log:
keep shot origin at least 1qu away from walls


Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2008-01-26 02:11:40 UTC (rev 3277)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2008-01-26 09:53:47 UTC (rev 3278)
@@ -24,6 +24,7 @@
 // make sure you call makevectors first (FIXME?)
 void(entity ent, vector vecs, float antilag, float recoil, string snd) W_SetupShot =
 {
+	float nudge = 1;
 	local vector trueaimpoint;
 	traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, self);
 	trueaimpoint = trace_endpos;
@@ -35,8 +36,8 @@
 	else
 		w_shotorg = ent.origin + ent.view_ofs + v_right * vecs_y + v_up * vecs_z;
 	// now move the shotorg forward as much as requested if possible
-	traceline_hitcorpse(self, w_shotorg, w_shotorg + v_forward * vecs_x, MOVE_NORMAL, self);
-	w_shotorg = trace_endpos;
+	traceline_hitcorpse(self, w_shotorg, w_shotorg + v_forward * (vecs_x + nudge), MOVE_NORMAL, self);
+	w_shotorg = trace_endpos - v_forward * nudge;
 	// calculate the shotdir from the chosen shotorg
 	w_shotdir = normalize(trueaimpoint - w_shotorg);
 




More information about the nexuiz-commits mailing list