r2291 - branches/nexuiz-2.0/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Apr 4 04:23:14 EDT 2007


Author: div0
Date: 2007-04-04 04:23:14 -0400 (Wed, 04 Apr 2007)
New Revision: 2291

Modified:
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
   branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
Log:
cleanup of player physics calls; no rebalancing in intermission


Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2007-04-04 08:21:45 UTC (rev 2290)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2007-04-04 08:23:14 UTC (rev 2291)
@@ -413,6 +413,8 @@
 		self.takedamage = DAMAGE_AIM;
 		self.effects = 0;
 		self.health = cvar("g_balance_health_start");
+		self.air_finished = time + 12;
+		self.dmg = 2;
 		self.armorvalue = cvar("g_balance_armor_start");
 		self.spawnshieldtime = time + cvar("g_spawnshieldtime");
 		self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
@@ -945,94 +947,6 @@
 	else self.colormod = '1 1 1';
 };*/
 
-/*
-=============
-PlayerJump
-
-When you press the jump key
-=============
-*/
-void PlayerJump (void)
-{
-	float mjumpheight;
-
-	mjumpheight = cvar("g_balance_jumpheight");
-	if (self.waterlevel >= 2)
-	{
-		if (self.watertype == CONTENT_WATER)
-			self.velocity_z = 200;
-		else if (self.watertype == CONTENT_SLIME)
-			self.velocity_z = 80;
-		else
-			self.velocity_z = 50;
-
-		return;
-	}
-
-
-	if (!(self.flags & FL_ONGROUND))
-		return;
-
-	if (!(self.flags & FL_JUMPRELEASED))
-		return;
-
-	if(cvar("g_runematch"))
-	{
-		if(self.runes & RUNE_SPEED)
-		{
-			if(self.runes & CURSE_SLOW)
-				mjumpheight = mjumpheight * cvar("g_balance_rune_speed_combo_jumpheight");
-			else
-				mjumpheight = mjumpheight * cvar("g_balance_rune_speed_jumpheight");
-		}
-		else if(self.runes & CURSE_SLOW)
-		{
-			mjumpheight = mjumpheight * cvar("g_balance_curse_slow_jumpheight");
-		}
-	}
-
-	if(cvar("g_minstagib") && (self.items & IT_INVINCIBLE))
-	{
-		mjumpheight = mjumpheight * cvar("g_balance_rune_speed_jumpheight");
-	}
-
-	self.velocity_z = self.velocity_z + mjumpheight;
-	self.oldvelocity_z = self.velocity_z;
-
-	self.flags = self.flags - FL_ONGROUND;
-	self.flags = self.flags - FL_JUMPRELEASED;
-}
-
-void() CheckWaterJump =
-{
-	local vector start, end;
-
-// check for a jump-out-of-water
-	makevectors (self.angles);
-	start = self.origin;
-	start_z = start_z + 8;
-	v_forward_z = 0;
-	normalize(v_forward);
-	end = start + v_forward*24;
-	traceline (start, end, TRUE, self);
-	if (trace_fraction < 1)
-	{	// solid at waist
-		start_z = start_z + self.maxs_z - 8;
-		end = start + v_forward*24;
-		self.movedir = trace_plane_normal * -50;
-		traceline (start, end, TRUE, self);
-		if (trace_fraction == 1)
-		{	// open at eye level
-			self.flags = self.flags | FL_WATERJUMP;
-			self.velocity_z = 225;
-			self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
-			self.teleport_time = time + 2;	// safety net
-			return;
-		}
-	}
-};
-
-
 void respawn(void)
 {
 	CopyBody(1);
@@ -1380,8 +1294,6 @@
 
 		CheckRules_Player();
 
-		Nixnex_GiveCurrentWeapon();
-
 		if(self.button7)
 			PrintWelcomeMessage(self);
 
@@ -1395,6 +1307,9 @@
 			return;					// the think tics
 		}
 
+		Nixnex_GiveCurrentWeapon();
+		UpdateSelectedPlayer();
+
 		if (self.deadflag != DEAD_NO)
 		{
 			float button_pressed, force_respawn;
@@ -1537,12 +1452,6 @@
 		else if (self.viewzoom < 1.0)
 			self.viewzoom = min (1.0, self.viewzoom + frametime);
 
-
-		if (self.button2)
-			PlayerJump ();
-		else
-			self.flags = self.flags | FL_JUMPRELEASED;
-
 		player_powerups();
 		player_regen();
 		player_anim();
@@ -1554,9 +1463,6 @@
 
 		//self.angles_y=self.v_angle_y + 90;   // temp
 
-		if (self.waterlevel == 2)
-			CheckWaterJump ();
-
 		//if (TetrisPreFrame()) return;
 	} else if(gameover) {
 		if (intermission_running)

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2007-04-04 08:21:45 UTC (rev 2290)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2007-04-04 08:23:14 UTC (rev 2291)
@@ -14,6 +14,94 @@
 .float lastflags;
 .float lastground;
 
+/*
+=============
+PlayerJump
+
+When you press the jump key
+=============
+*/
+void PlayerJump (void)
+{
+	float mjumpheight;
+
+	mjumpheight = cvar("g_balance_jumpheight");
+	if (self.waterlevel >= 2)
+	{
+		if (self.watertype == CONTENT_WATER)
+			self.velocity_z = 200;
+		else if (self.watertype == CONTENT_SLIME)
+			self.velocity_z = 80;
+		else
+			self.velocity_z = 50;
+
+		return;
+	}
+
+
+	if (!(self.flags & FL_ONGROUND))
+		return;
+
+	if (!(self.flags & FL_JUMPRELEASED))
+		return;
+
+	if(cvar("g_runematch"))
+	{
+		if(self.runes & RUNE_SPEED)
+		{
+			if(self.runes & CURSE_SLOW)
+				mjumpheight = mjumpheight * cvar("g_balance_rune_speed_combo_jumpheight");
+			else
+				mjumpheight = mjumpheight * cvar("g_balance_rune_speed_jumpheight");
+		}
+		else if(self.runes & CURSE_SLOW)
+		{
+			mjumpheight = mjumpheight * cvar("g_balance_curse_slow_jumpheight");
+		}
+	}
+
+	if(cvar("g_minstagib") && (self.items & IT_INVINCIBLE))
+	{
+		mjumpheight = mjumpheight * cvar("g_balance_rune_speed_jumpheight");
+	}
+
+	self.velocity_z = self.velocity_z + mjumpheight;
+	self.oldvelocity_z = self.velocity_z;
+
+	self.flags = self.flags - FL_ONGROUND;
+	self.flags = self.flags - FL_JUMPRELEASED;
+}
+
+void() CheckWaterJump =
+{
+	local vector start, end;
+
+// check for a jump-out-of-water
+	makevectors (self.angles);
+	start = self.origin;
+	start_z = start_z + 8;
+	v_forward_z = 0;
+	normalize(v_forward);
+	end = start + v_forward*24;
+	traceline (start, end, TRUE, self);
+	if (trace_fraction < 1)
+	{	// solid at waist
+		start_z = start_z + self.maxs_z - 8;
+		end = start + v_forward*24;
+		self.movedir = trace_plane_normal * -50;
+		traceline (start, end, TRUE, self);
+		if (trace_fraction == 1)
+		{	// open at eye level
+			self.flags = self.flags | FL_WATERJUMP;
+			self.velocity_z = 225;
+			self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
+			self.teleport_time = time + 2;	// safety net
+			return;
+		}
+	}
+};
+
+
 void Nixnex_GiveCurrentWeapon();
 void SV_PlayerPhysics()
 {
@@ -94,8 +182,6 @@
 	if (self.deadflag)
 		return;
 
-	UpdateSelectedPlayer();
-
 	if (!self.fixangle)
 	{
 		self.angles_x = 0;
@@ -103,6 +189,17 @@
 		self.angles_z = 0;
 	}
 
+	if(self.classname == "player")
+	{
+		if (self.button2)
+			PlayerJump ();
+		else
+			self.flags = self.flags | FL_JUMPRELEASED;
+
+		if (self.waterlevel == 2)
+			CheckWaterJump ();
+	}
+
 	if (self.flags & FL_WATERJUMP )
 	{
 		self.velocity_x = self.movedir_x;

Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2007-04-04 08:21:45 UTC (rev 2290)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2007-04-04 08:23:14 UTC (rev 2291)
@@ -16,6 +16,8 @@
 float audit_teams_time;
 
 float() IsTeamBalanceForced = {
+	if(intermission_running)
+		return 0; // no rebalancing whatsoever please
 	if(!cvar("teamplay"))
 		return 0;
 	if(cvar("g_campaign"))




More information about the nexuiz-commits mailing list