r4031 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Aug 5 12:37:38 EDT 2008


Author: div0
Date: 2008-08-05 12:37:38 -0400 (Tue, 05 Aug 2008)
New Revision: 4031

Modified:
   trunk/data/qcsrc/server/cl_physics.qc
Log:
fix fall sound on slopes


Modified: trunk/data/qcsrc/server/cl_physics.qc
===================================================================
--- trunk/data/qcsrc/server/cl_physics.qc	2008-08-05 16:26:45 UTC (rev 4030)
+++ trunk/data/qcsrc/server/cl_physics.qc	2008-08-05 16:37:38 UTC (rev 4031)
@@ -13,6 +13,7 @@
 .float swamp_slowdown;
 .float lastflags;
 .float lastground;
+.float wasFlying;
 
 #define SHTEST_DELTA 15
 .float shtest_next;
@@ -234,23 +235,30 @@
 	}
 
 	if(self.flags & FL_ONGROUND)
-	if not(self.lastflags & FL_ONGROUND)
-	if(self.waterlevel < 2)
-	if(time >= self.ladder_time)
-	if not(self.hook)
+	if(self.wasFlying)
 	{
-		self.nextstep = time + 0.3 + random() * 0.1;
-		trace_dphitq3surfaceflags = 0;
-		tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
-		if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+		self.wasFlying = 0;
+
+		if(self.waterlevel < 2)
+		if(time >= self.ladder_time)
+		if not(self.hook)
 		{
-			if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
-				GlobalSound(globalsound_metalfall, CHAN_AUTO, 0);
-			else
-				GlobalSound(globalsound_fall, CHAN_AUTO, 0);
+			self.nextstep = time + 0.3 + random() * 0.1;
+			trace_dphitq3surfaceflags = 0;
+			tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
+			if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+			{
+				if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
+					GlobalSound(globalsound_metalfall, CHAN_AUTO, 0);
+				else
+					GlobalSound(globalsound_fall, CHAN_AUTO, 0);
+			}
 		}
 	}
 
+	if(IsFlying(self))
+		self.wasFlying = 1;
+
 	if(self.classname == "player")
 	{
 		if(sv_doublejump)




More information about the nexuiz-commits mailing list