[nexuiz-commits] r7795 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Sep 15 04:25:38 EDT 2009


Author: div0
Date: 2009-09-15 04:25:30 -0400 (Tue, 15 Sep 2009)
New Revision: 7795

Modified:
   trunk/data/qcsrc/server/cl_weaponsystem.qc
Log:
trueaim: do a no-world trace for the rifle so shots aren't adjusted in vain when shooting through walls


Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-09-15 07:12:23 UTC (rev 7794)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-09-15 08:25:30 UTC (rev 7795)
@@ -131,17 +131,24 @@
 	float nudge = 1; // added to traceline target and subtracted from result
 	local vector trueaimpoint;
 	local float oldsolid;
+	float oldmask;
 	vector vecs, dv;
 	oldsolid = ent.dphitcontentsmask;
-	ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
-	traceline(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, ent); // no antilag needed
+	if(ent.weapon == WEP_CAMPINGRIFLE)
+		ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+	else
+		ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+	if(antilag)
+		traceline_antilag(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent));
+	else
+		traceline(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, ent, ANTILAG_LATENCY(ent));
 	trueaimpoint = trace_endpos;
 
 	// Track max damage and set the stat to be sent later in g_world.qc
 	if not(inWarmupStage)
 	{
-		self.max_damage[self.weapon] += maxdamage;
-		self.maxdamage_fired = self.weapon + 64 * rint(self.max_damage[self.weapon]);
+		ent.max_damage[ent.weapon] += maxdamage;
+		ent.maxdamage_fired = ent.weapon + 64 * rint(ent.max_damage[ent.weapon]);
 	}
 
 	W_HitPlotAnalysis(ent, v_forward, v_right, v_up);



More information about the nexuiz-commits mailing list