[nexuiz-commits] r6686 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri May 8 05:58:44 EDT 2009


Author: div0
Date: 2009-05-08 05:58:44 -0400 (Fri, 08 May 2009)
New Revision: 6686

Modified:
   trunk/data/physicsWarsow.cfg
   trunk/data/qcsrc/server/cl_physics.qc
Log:
simplifying Warsow-style physics code even more, as it now can use a common code path with Quake-style physics (the only difference there is is when moving forward only).

This could be done after the observation that CPMA-style acceleration never kicks in in Warsow mode.

The sv_aircontrol is now expected to be zero in Warsow-style mode, as it does nothing in that mode anyway! If you do set it, you get Warsow and CPMA air control added!


Modified: trunk/data/physicsWarsow.cfg
===================================================================
--- trunk/data/physicsWarsow.cfg	2009-05-08 09:45:43 UTC (rev 6685)
+++ trunk/data/physicsWarsow.cfg	2009-05-08 09:58:44 UTC (rev 6686)
@@ -14,6 +14,6 @@
 sv_airstopaccelerate 2.5
 sv_airstrafeaccelerate 70
 sv_maxairstrafespeed 30
-sv_aircontrol 150
+sv_aircontrol 0
 sv_warsowbunny_turnaccel 9 // activates warsow movement mode
 set sv_friction_on_land 0

Modified: trunk/data/qcsrc/server/cl_physics.qc
===================================================================
--- trunk/data/qcsrc/server/cl_physics.qc	2009-05-08 09:45:43 UTC (rev 6685)
+++ trunk/data/qcsrc/server/cl_physics.qc	2009-05-08 09:58:44 UTC (rev 6686)
@@ -920,62 +920,32 @@
 			wishspeed = wishspeed * 0.5;
 		if (time >= self.teleport_time)
 		{
-			if(sv_warsowbunny_turnaccel)
-			{
-				float accelerating, decelerating;
-				//float aircontrol;
-				float wishspeed2;
+			float accelerating;
+			float wishspeed2;
 
-				accelerating = (self.velocity * wishdir > 0);
-				decelerating = (self.velocity * wishdir < 0);
-				//aircontrol = FALSE;
-				wishspeed2 = wishspeed;
+			accelerating = (self.velocity * wishdir > 0);
+			wishspeed2 = wishspeed;
 
-				if(accelerating && self.movement_y == 0 && self.movement_x != 0)
-				{
-					PM_AirAccelerate(wishdir, wishspeed);
-				}
-				else
-				{
-					if(sv_airstopaccelerate)
-						if(self.velocity * wishdir < 0)
-							airaccel = sv_airstopaccelerate;
-					if(self.movement_x == 0 && self.movement_y != 0)
-					{
-						if(sv_maxairstrafespeed)
-							wishspeed = min(wishspeed, sv_maxairstrafespeed);
-						if(sv_airstrafeaccelerate)
-							airaccel = sv_airstrafeaccelerate;
-						//if(sv_aircontrol)
-							//aircontrol = TRUE;
-					}
-
-					PM_Accelerate(wishdir, wishspeed, airaccel, sv_airaccel_qw, sv_airaccel_sideways_friction / maxairspd);
-
-					//if(aircontrol)
-						//CPM_PM_Aircontrol(wishdir, wishspeed2);
-						// div0: this never kicks in, as aircontrol is only set to TRUE if self.movement_x == 0 && self.movement_y != 0, but then the function does nothing
-				}
+			// CPM
+			if(sv_airstopaccelerate)
+				if(self.velocity * wishdir < 0)
+					airaccel = sv_airstopaccelerate;
+			if(self.movement_x == 0 && self.movement_y != 0)
+			{
+				if(sv_maxairstrafespeed)
+					wishspeed = min(wishspeed, sv_maxairstrafespeed);
+				if(sv_airstrafeaccelerate)
+					airaccel = sv_airstrafeaccelerate;
 			}
+			// !CPM
+
+			if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
+				PM_AirAccelerate(wishdir, wishspeed);
 			else
-			{
-				// CPM: air control
-				if(sv_airstopaccelerate)
-					if(self.velocity * wishdir < 0)
-						airaccel = sv_airstopaccelerate;
-				if(self.movement_x == 0 && self.movement_y != 0)
-				{
-					if(sv_maxairstrafespeed)
-						wishspeed = min(wishspeed, sv_maxairstrafespeed);
-					if(sv_airstrafeaccelerate)
-						airaccel = sv_airstrafeaccelerate;
-				}
-				// !CPM
-				
 				PM_Accelerate(wishdir, wishspeed, airaccel, sv_airaccel_qw, sv_airaccel_sideways_friction / maxairspd);
-				if(sv_aircontrol)
-					CPM_PM_Aircontrol(wishdir, wishspeed2);
-			}
+
+			if(sv_aircontrol)
+				CPM_PM_Aircontrol(wishdir, wishspeed2);
 		}
 	}
 



More information about the nexuiz-commits mailing list