r3849 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Jul 20 12:14:56 EDT 2008


Author: div0
Date: 2008-07-20 12:14:56 -0400 (Sun, 20 Jul 2008)
New Revision: 3849

Modified:
   trunk/data/qcsrc/server/cl_impulse.qc
Log:
impulse 911: also rule out looking at just sky


Modified: trunk/data/qcsrc/server/cl_impulse.qc
===================================================================
--- trunk/data/qcsrc/server/cl_impulse.qc	2008-07-20 15:23:16 UTC (rev 3848)
+++ trunk/data/qcsrc/server/cl_impulse.qc	2008-07-20 16:14:56 UTC (rev 3849)
@@ -326,16 +326,20 @@
 						end_x = org_x + random() * delta_x;
 						end_y = org_y + random() * delta_y;
 						end_z = org_z + random() * delta_z;
-						end = start + normalize(end - start) * 256;
+						end = start + normalize(end - start) * vlen(delta);
 
 						// rule 3: start TO end must not be too short
 						tracebox(start, self.mins, self.maxs, end, MOVE_NORMAL, self);
 						if(trace_startsolid)
 							continue;
-						if(trace_fraction < 1)
+						if(trace_fraction < 256 / vlen(delta))
 							continue;
 
-						// rule 4: we must not end up in trigger_hurt
+						// rule 4: don't want to look at sky
+						if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)
+							continue;
+
+						// rule 5: we must not end up in trigger_hurt
 						if(tracebox_hits_trigger_hurt(start, self.mins, self.maxs, enddown))
 						{
 							dprint("trigger_hurt! ouch! and nothing else could find it!\n");




More information about the nexuiz-commits mailing list