r5702 - in branches/nexuiz-2.0: . data data/qcsrc/client data/qcsrc/menu/nexuiz data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 31 06:16:00 EST 2009


Author: div0
Date: 2009-01-31 06:15:59 -0500 (Sat, 31 Jan 2009)
New Revision: 5702

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/qcsrc/client/Main.qc
   branches/nexuiz-2.0/data/qcsrc/client/View.qc
   branches/nexuiz-2.0/data/qcsrc/client/main.qh
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playerlist.c
   branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
Log:
r5699 | div0 | 2009-01-30 21:27:12 +0100 (Fri, 30 Jan 2009) | 2 lines
make spawnshield automatically disable when you shoot
r5700 | mand1nga | 2009-01-31 03:26:39 +0100 (Sat, 31 Jan 2009) | 7 lines
Demo camera refactoring
Changed camera binds, now it is mostly controlled by the standard movement keys (and the not so popular +move[up/down] cmds)
Fixed camera acceleration when moving in more than one dimension at the same time
Better behaviour when opposite direction keys are pressed at the same time
Restore chase_active value when disabling the camera or quitting the application
Better bot cvar descriptions
r5701 | div0 | 2009-01-31 10:48:43 +0100 (Sat, 31 Jan 2009) | 2 lines
terencehill's score column after a cleanup

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/.patchsets	2009-01-31 11:15:59 UTC (rev 5702)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-5697
+revisions_applied = 1-5701

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-01-31 11:15:59 UTC (rev 5702)
@@ -354,6 +354,13 @@
 set bot_ai_keyboard_treshold 0.57
 set bot_ai_aimskill_offset 1
 set bot_ai_aimskill_think 1
+set bot_ai_custom_weapon_priority_distances "200 1000"	"Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
+set bot_ai_custom_weapon_priority_far "11 7 15 14 4 5 8 13 6 1 3 9 2"	"Desired weapons for far distances ordered by priority"
+set bot_ai_custom_weapon_priority_mid "11 9 4 5 3 7 15 14 6 13 8 2 1"	"Desired weapons for middle distances ordered by priority"
+set bot_ai_custom_weapon_priority_close "11 3 9 13 14 8 6 4 2 5 7 15 1"	"Desired weapons for close distances ordered by priority"
+set bot_ai_weapon_combo 1	"Enable bots to do weapon combos"
+set bot_ai_weapon_combo_threshold 0.3	"Try to make a combo N seconds after the last attack"
+set bot_ai_friends_aware_pickup_radius "500"	"Bots will not pickup items if a team mate is this distance near the item"
 // Better don't touch these, there are hard to tweak!
 set bot_ai_aimskill_order_mix_1st 0.01
 set bot_ai_aimskill_order_mix_2nd 0.1
@@ -365,13 +372,6 @@
 set bot_ai_aimskill_order_filter_3th 0.05
 set bot_ai_aimskill_order_filter_4th 0.25
 set bot_ai_aimskill_order_filter_5th 0.3
-set bot_ai_custom_weapon_priority_distances "200 1000"	"Define close and far distances in any order, the bots will detect middle distances automatically. "
-set bot_ai_custom_weapon_priority_far "11 7 15 14 4 5 8 13 6 1 3 9 2"	"Desired weapons in any order. Up to the max ammount of weapons available in the system "
-set bot_ai_custom_weapon_priority_mid "11 9 4 5 3 7 15 14 6 13 8 2 1"	"same as previous "
-set bot_ai_custom_weapon_priority_close "11 3 9 13 14 8 6 4 2 5 7 15 1"	"same as previous"
-set bot_ai_weapon_combo 1	"Enable weapon combos "
-set bot_ai_weapon_combo_threshold 0.3	"Try to make a combo N seconds after the last attack"
-set bot_ai_friends_aware_pickup_radius "500"
 
 // waypoint editor enable
 set g_waypointeditor 0
@@ -1385,39 +1385,19 @@
 set g_full_getstatus_responses 0	"this currently breaks qstat"
 
 // Defaults and aliases for the demo camera
-alias camera_enable "set cl_demo_mousegrab 1; set _chase_active $chase_active; chase_active 2;" // Enables the camera for demo playback
-alias camera_disable "set cl_demo_mousegrab 0; chase_active $_chase_active;" // Disables the camera for demo playback
-
-set camera_speed_roll 0.9		"Camera rotation speed "
-set camera_speed_chase 4		"Camera movement speed on the x/y/z axis while chasing the player"
-set camera_speed_free 8			"Camera movement speed on the x/y/z axis in free mode"
-set camera_speed_attenuation 30		"Camera movements attenuation factor. Bigger is smoother. Applies to mouse movements."
-set camera_free 0			"Free camera instead of chasing the player"
-set camera_reset 0			"Reset the camera position"
-set camera_direction_x 0		"Move the camera on the x axis (relative to the camera angle)"
-set camera_direction_y 0		"Move the camera on the y axis (relative to the camera angle)"
-set camera_direction_z 0		"Move the camera on the z axis (relative to the camera rotation)"
-set camera_mouse_treshold 0.5		"Use to ignore small mouse movements. This allows for smoother camera control"
-set camera_chase_smoothly 0		"Attenuate player movements (only in chase mode)"
-set camera_look_player	0		"Always look to the player. Mouse input is ignored in this mode."
+set camera_enable 		0	"Enables the camera for demo playback"
+set camera_free 		0	"Free camera instead of chasing the player"
+set camera_reset 		0	"Resets the camera position and switch to chase mode"
+set camera_speed_roll 		0.9	"Camera rotation speed"
+set camera_speed_chase 		4	"Camera movement speed on the x/y/z axis while chasing the player"
+set camera_speed_free 		8	"Camera movement speed on the x/y/z axis in free mode"
+set camera_speed_attenuation 	30	"Camera movements attenuation factor. Bigger is smoother. Applies to mouse movements."
+set camera_mouse_treshold 	0.5	"Use to ignore small mouse movements. This allows for smoother camera control"
+set camera_chase_smoothly 	0	"Attenuate player movements (only in chase mode)"
+set camera_look_player		0	"Always look to the player. Mouse input is ignored in this mode."
 set camera_look_attenuation 	8	"Attenuation of \"looking\" movements, only if camera_look_player is set. Bigger is smoother."
-set camera_forward_follows 0		"0: Move the camera forwards without changing altitude. 1: Move towards what you are looking."
+set camera_forward_follows 	1	"0: Move the camera forwards without changing altitude. 1: Move towards what you are looking."
 
-alias +camera_move_forward "set camera_direction_x 1"
-alias -camera_move_forward "set camera_direction_x 0"
-alias +camera_move_backward "set camera_direction_x -1"
-alias -camera_move_backward -camera_move_forward
-
-alias +camera_move_left "set camera_direction_y 1"
-alias -camera_move_left "set camera_direction_y 0"
-alias +camera_move_right "set camera_direction_y -1"
-alias -camera_move_right -camera_move_left
-
-alias +camera_move_up "set camera_direction_z 1"
-alias -camera_move_up "set camera_direction_z 0"
-alias +camera_move_down "set camera_direction_z -1"
-alias -camera_move_down -camera_move_up
-
 alias +camera_roll_right "set camera_roll 1"
 alias -camera_roll_right "set camera_roll 0"
 alias +camera_roll_left "set camera_roll -1"

Modified: branches/nexuiz-2.0/data/qcsrc/client/Main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2009-01-31 11:15:59 UTC (rev 5702)
@@ -83,6 +83,19 @@
 	registercmd("+button4");
 	registercmd("-button4");
 
+#ifndef CAMERATEST
+	if(isdemo())
+	{
+#endif
+		registercmd("+forward");registercmd("-forward");
+		registercmd("+back");registercmd("-back");
+		registercmd("+moveup");registercmd("-moveup");
+		registercmd("+movedown");registercmd("-movedown");
+		registercmd("+moveright");registercmd("-moveright");
+		registercmd("+moveleft");registercmd("-moveleft");
+#ifndef CAMERATEST
+	}
+#endif
 	registercvar("sbar_usecsqc", "1");
 	registercvar("sbar_columns", "default", CVAR_SAVE);
 
@@ -163,6 +176,9 @@
 	db_close(tempdb);
 
 	cvar_clientsettemp_restore();
+
+	if(camera_active)
+		cvar_set("chase_active",ftos(chase_active_backup));
 }
 
 .float has_team;
@@ -306,7 +322,28 @@
 		sb_showscores = false;
 		return true;
 	}
-	
+
+	if(camera_active)
+	if(strCmd == "+forward" || strCmd == "-back") {
+		++camera_direction_x;
+		return true;
+	} else if(strCmd == "-forward" || strCmd == "+back") {
+		--camera_direction_x;
+		return true;
+	} else if(strCmd == "+moveright" || strCmd == "-moveleft") {
+		--camera_direction_y;
+		return true;
+	} else if(strCmd == "-moveright" || strCmd == "+moveleft") {
+		++camera_direction_y;
+		return true;
+	} else if(strCmd == "+moveup" || strCmd == "-movedown") {
+		++camera_direction_z;
+		return true;
+	} else if(strCmd == "-moveup" || strCmd == "+movedown") {
+		--camera_direction_z;
+		return true;
+	}
+
 	return false;
 }
 

Modified: branches/nexuiz-2.0/data/qcsrc/client/View.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-01-31 11:15:59 UTC (rev 5702)
@@ -94,7 +94,6 @@
 	return v_y * 0.01745329251994329576;
 }
 
-float camera_active;
 vector GetCurrentFov(float fov)
 {
 	float zoomsensitivity, zoomspeed, zoomfactor, zoomdir;
@@ -171,17 +170,17 @@
 void CSQC_kh_hud(void);
 void CSQC_ctf_hud(void);
 void PostInit(void);
+void CSQC_Demo_Camera();
 float Sbar_WouldDrawScoreboard ();
 float zoomscript_caught;
 float view_set;
 float camera_mode;
-vector camera_offset, current_origin, mouse_angles, current_camera_offset, new_angles;
 void CSQC_UpdateView(float w, float h)
 {
 	entity e;
 	float fov;
 	float f;
-	vector v1, v2, delta;
+	vector v1, v2;
 
 	dprint_load();
 	WaypointSprite_Load();
@@ -295,162 +294,29 @@
 	R_SetView(VF_FOV, GetCurrentFov(fov));
 
 	// Camera for demo playback
-	if (cvar("chase_active") > 1 && cvar("cl_demo_mousegrab") && isdemo())
+	if(camera_active)
 	{
-		float speed, attenuation;
-		vector new_origin, m;
-
-		if(!camera_active)
-			camera_active = TRUE;
-		
-		if(cvar("camera_free"))
-			speed = cvar("camera_speed_free");
+		if(cvar("camera_enable"))
+			CSQC_Demo_Camera();
 		else
-			speed = cvar("camera_speed_chase");
-			
-		attenuation = cvar("camera_speed_attenuation");
-		
-		attenuation = 1 / max(1, attenuation);
-
-		if( cvar("camera_reset") || !camera_mode )
 		{
-			camera_offset = '0 0 0';
-			new_angles = view_angles;
-			camera_offset_z += 20;
-			camera_offset_x += 20 * -cos(new_angles_y * DEG2RAD);
-			camera_offset_y += 20 * -sin(new_angles_y * DEG2RAD);
-			current_origin = view_origin;
+			cvar_set("chase_active", ftos(chase_active_backup));
+			cvar_set("cl_demo_mousegrab", "0");
+			camera_active = FALSE;
 		}
-
-		// Camera angles
-		if( cvar("camera_roll") )
-			mouse_angles_z += cvar("camera_roll") * cvar("camera_speed_roll");
-
-		if(!cvar("camera_look_player"))
-		{
-			m = getmousepos() * 0.1;
-			if(vlen(m)>cvar("camera_mouse_treshold"))
-			{
-				mouse_angles_x += m_y * cos(mouse_angles_z * DEG2RAD) + (m_x * sin(mouse_angles_z * DEG2RAD));
-				mouse_angles_y -= m_x * cos(mouse_angles_z * DEG2RAD) + (m_y * -sin(mouse_angles_z * DEG2RAD));
-			}
-
-			while (mouse_angles_x < -180)
-				mouse_angles_x = mouse_angles_x + 360;
-			while (mouse_angles_x > 180)
-				mouse_angles_x = mouse_angles_x - 360;
-			while (mouse_angles_y < -180)
-				mouse_angles_y = mouse_angles_y + 360;
-			while (mouse_angles_y > 180)
-				mouse_angles_y = mouse_angles_y - 360;
-			
-			delta = '0 0 0';			
-			if( mouse_angles_y < -90 && new_angles_y > 0)
-				delta = '0 360 0';
-			if( mouse_angles_y > 90 && new_angles_y < -90)
-				delta = '0 -360 0';
-
-			new_angles += (mouse_angles - new_angles + delta) * attenuation;
-		}
-		
-		// Camera position
-		if( cvar("camera_direction_x") )
-		{
-			camera_offset_x += cvar("camera_direction_x") * speed * cos(new_angles_y * DEG2RAD);
-			camera_offset_y += cvar("camera_direction_x") * speed * sin(new_angles_y * DEG2RAD);
-			if( cvar("camera_forward_follows") )
-				camera_offset_z += cvar("camera_direction_x") * speed * -sin(new_angles_x * DEG2RAD);
-		}
-
-		if( cvar("camera_direction_y") )
-		{
-			camera_offset_y += cvar("camera_direction_y") * speed * cos(new_angles_y * DEG2RAD) * cos(new_angles_z * DEG2RAD);
-			camera_offset_x += cvar("camera_direction_y") * speed * -sin(new_angles_y * DEG2RAD);
-			camera_offset_z += cvar("camera_direction_y") * speed * sin(new_angles_z * DEG2RAD);
-		}
-
-		if( cvar("camera_direction_z") )
-			camera_offset_z += cvar("camera_direction_z") * speed * cos(new_angles_z * DEG2RAD);
-
-		current_camera_offset += (camera_offset - current_camera_offset) * attenuation;
-
-		// Camera modes
-		if( cvar("camera_free") )
-		{
-			if ( camera_mode == CAMERA_CHASE )
-			{
-				current_camera_offset = current_origin + current_camera_offset;
-				camera_offset = current_origin + camera_offset;
-			}
-
-			camera_mode = CAMERA_FREE;
-			new_origin = current_camera_offset;
-		}
-		else
-		{
-			if ( camera_mode == CAMERA_FREE )
-			{
-				current_origin = view_origin;
-				camera_offset = camera_offset - current_origin;
-				current_camera_offset = current_camera_offset - current_origin;
-			}
-
-			camera_mode = CAMERA_CHASE;
-			
-			if(cvar("camera_chase_smoothly"))
-				current_origin += (view_origin - current_origin) * attenuation;
-			else
-				current_origin = view_origin;
-				
-			new_origin = current_origin + current_camera_offset;
-		}
-
-		if(cvar("camera_look_player"))
-		{
-			local vector dir;
-			local float n;
-			
-			dir = normalize(view_origin - new_origin);
-			n = mouse_angles_z;
-			mouse_angles = vectoangles(dir);
-			mouse_angles_x = mouse_angles_x * -1;
-			mouse_angles_z = n;
-
-			while (mouse_angles_x < -180)
-				mouse_angles_x = mouse_angles_x + 360;
-			while (mouse_angles_x > 180)
-				mouse_angles_x = mouse_angles_x - 360;
-			while (mouse_angles_y < -180)
-				mouse_angles_y = mouse_angles_y + 360;
-			while (mouse_angles_y > 180)
-				mouse_angles_y = mouse_angles_y - 360;
-
-			delta = '0 0 0';
-			if(mouse_angles_y < -90 && new_angles_y > 0)
-				delta = '0 360 0';
-			if(mouse_angles_y > 90 && new_angles_y < -90)
-				delta = '0 -360 0';
-
-			n = 1 / max(1, cvar("camera_look_attenuation"));		
-			new_angles += (mouse_angles - new_angles + delta) * n;
-		}
-
-		while (new_angles_x < -180)
-			new_angles_x = new_angles_x + 360;
-		while (new_angles_x > 180)
-			new_angles_x = new_angles_x - 360;
-		while (new_angles_y < -180)
-			new_angles_y = new_angles_y + 360;
-		while (new_angles_y > 180)
-			new_angles_y = new_angles_y - 360;
-
-		R_SetView(VF_ANGLES, new_angles);
-		R_SetView(VF_ORIGIN, new_origin);
 	}
-	else
+#ifdef CAMERATEST
+	else if(cvar("camera_enable"))
+#else
+	else if(cvar("camera_enable") && isdemo())
+#endif
 	{
-		if(camera_active)
-			camera_active = FALSE;
+		// Enable required Darkplaces cvars
+		chase_active_backup = cvar("chase_active");
+		cvar_set("chase_active", "2");		
+		cvar_set("cl_demo_mousegrab", "1");
+		camera_active = TRUE;
+		camera_mode = FALSE;
 	}
 	
 	// Draw the Crosshair
@@ -671,3 +537,150 @@
 	}
 
 }
+
+// following vectors must be global to allow seamless switching between camera modes
+vector camera_offset, current_camera_offset, mouse_angles, current_angles, current_origin, camera_position, current_position;
+void CSQC_Demo_Camera()
+{
+	float speed, attenuation, dimensions;
+	vector tmp, delta;
+
+	if( cvar("camera_reset") || !camera_mode )
+	{
+		camera_offset = '0 0 0';
+		current_angles = '0 0 0';
+		camera_direction = '0 0 0';
+		camera_offset_z += 30;
+		camera_offset_x += 30 * -cos(current_angles_y * DEG2RAD);
+		camera_offset_y += 30 * -sin(current_angles_y * DEG2RAD);
+		current_origin = view_origin;
+		current_camera_offset  = camera_offset;
+		cvar_set("camera_reset", "0");
+		camera_mode = CAMERA_CHASE;
+	}
+
+	// Camera angles
+	if( cvar("camera_roll") )
+		mouse_angles_z += cvar("camera_roll") * cvar("camera_speed_roll");
+
+	if(cvar("camera_look_player"))
+	{
+		local vector dir;
+		local float n;
+
+		dir = normalize(view_origin - current_position);
+		n = mouse_angles_z;
+		mouse_angles = vectoangles(dir);
+		mouse_angles_x = mouse_angles_x * -1;
+		mouse_angles_z = n;
+	}
+	else
+	{
+		tmp = getmousepos() * 0.1;
+		if(vlen(tmp)>cvar("camera_mouse_treshold"))
+		{
+			mouse_angles_x += tmp_y * cos(mouse_angles_z * DEG2RAD) + (tmp_x * sin(mouse_angles_z * DEG2RAD));
+			mouse_angles_y -= tmp_x * cos(mouse_angles_z * DEG2RAD) + (tmp_y * -sin(mouse_angles_z * DEG2RAD));
+		}
+	}
+
+	while (mouse_angles_x < -180) mouse_angles_x = mouse_angles_x + 360;
+	while (mouse_angles_x > 180) mouse_angles_x = mouse_angles_x - 360;
+	while (mouse_angles_y < -180) mouse_angles_y = mouse_angles_y + 360;
+	while (mouse_angles_y > 180) mouse_angles_y = mouse_angles_y - 360;
+
+	// Wrap angles for quick movements
+	delta = '0 0 0';
+	if(mouse_angles_y < -60 && current_angles_y > 60)
+		delta = '0 360 0';
+	if(mouse_angles_y > 60 && current_angles_y < -60)
+		delta = '0 -360 0';
+	//
+
+	if(cvar("camera_look_player"))
+		attenuation = cvar("camera_look_attenuation");
+	else
+		attenuation = cvar("camera_speed_attenuation");
+
+	attenuation = 1 / max(1, attenuation);
+	current_angles += (mouse_angles - current_angles + delta) * attenuation;
+
+	while (current_angles_x < -180) current_angles_x = current_angles_x + 360;
+	while (current_angles_x > 180) current_angles_x = current_angles_x - 360;
+	while (current_angles_y < -180) current_angles_y = current_angles_y + 360;
+	while (current_angles_y > 180) current_angles_y = current_angles_y - 360;
+
+	// Camera position
+	tmp = '0 0 0';
+	dimensions = 0;
+
+	if( camera_direction_x )
+	{
+		tmp_x = camera_direction_x * cos(current_angles_y * DEG2RAD);
+		tmp_y = camera_direction_x * sin(current_angles_y * DEG2RAD);
+		if( cvar("camera_forward_follows") && !cvar("camera_look_player") )
+			tmp_z = camera_direction_x * -sin(current_angles_x * DEG2RAD);
+		++dimensions;
+	}
+
+	if( camera_direction_y )
+	{
+		tmp_x += camera_direction_y * -sin(current_angles_y * DEG2RAD);
+		tmp_y += camera_direction_y * cos(current_angles_y * DEG2RAD) * cos(current_angles_z * DEG2RAD);
+		tmp_z += camera_direction_y * sin(current_angles_z * DEG2RAD);
+		++dimensions;
+	}
+
+	if( camera_direction_z )
+	{
+		tmp_z += camera_direction_z * cos(current_angles_z * DEG2RAD);
+		++dimensions;
+	}
+
+	if(cvar("camera_free"))
+		speed = cvar("camera_speed_free");
+	else
+		speed = cvar("camera_speed_chase");
+
+	if(dimensions)
+	{
+		speed = speed * sqrt(1 / dimensions);
+		camera_offset += tmp * speed;
+	}
+
+	current_camera_offset += (camera_offset - current_camera_offset) * attenuation;
+
+	// Camera modes
+	if( cvar("camera_free") )
+	{
+		if ( camera_mode == CAMERA_CHASE )
+		{
+			current_camera_offset = current_origin + current_camera_offset;
+			camera_offset = current_origin + camera_offset;
+		}
+
+		camera_mode = CAMERA_FREE;
+		current_position = current_camera_offset;
+	}
+	else
+	{
+		if ( camera_mode == CAMERA_FREE )
+		{
+			current_origin = view_origin;
+			camera_offset = camera_offset - current_origin;
+			current_camera_offset = current_camera_offset - current_origin;
+		}
+
+		camera_mode = CAMERA_CHASE;
+
+		if(cvar("camera_chase_smoothly"))
+			current_origin += (view_origin - current_origin) * attenuation;
+		else
+			current_origin = view_origin;
+
+		current_position = current_origin + current_camera_offset;
+	}
+
+	R_SetView(VF_ANGLES, current_angles);
+	R_SetView(VF_ORIGIN, current_position);
+}

Modified: branches/nexuiz-2.0/data/qcsrc/client/main.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/main.qh	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/qcsrc/client/main.qh	2009-01-31 11:15:59 UTC (rev 5702)
@@ -138,3 +138,7 @@
 
 float cs_project_is_b0rked;
 float vid_width, vid_height, vid_pixelheight;
+
+float camera_active;		// Demo camera is active if set to TRUE
+float chase_active_backup;
+vector camera_direction;
\ No newline at end of file

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_join_serverinfo.c	2009-01-31 11:15:59 UTC (rev 5702)
@@ -123,7 +123,7 @@
 			me.cnameLabel = e;
 
 	me.TR(me);
-		me.TD(me, 1, 6, e = makeNexuizTextLabel(0, "Players:"));
+		me.TD(me, 1, 5.5, e = makeNexuizTextLabel(0, "Players:"));
 	me.TR(me);
 		me.TD(me, me.rows - 4, 5.5, e = makeNexuizPlayerList());
 			me.rawPlayerList = e;

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playerlist.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playerlist.c	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playerlist.c	2009-01-31 11:15:59 UTC (rev 5702)
@@ -6,6 +6,8 @@
 	ATTRIB(NexuizPlayerList, realFontSize, vector, '0 0 0')
 	ATTRIB(NexuizPlayerList, columnNameOrigin, float, 0)
 	ATTRIB(NexuizPlayerList, columnNameSize, float, 0)
+	ATTRIB(NexuizPlayerList, columnScoreOrigin, float, 0)
+	ATTRIB(NexuizPlayerList, columnScoreSize, float, 0)
 	ATTRIB(NexuizPlayerList, realUpperMargin, float, 0)
 	ATTRIB(NexuizPlayerList, origin, vector, '0 0 0')
 	ATTRIB(NexuizPlayerList, itemAbsSize, vector, '0 0 0')
@@ -84,13 +86,18 @@
 	me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth)));
 	me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
 
+	// this list does 1 char left and right margin
+	me.columnScoreSize = 3 * me.realFontSize_x;
+	me.columnNameSize = 1 - 3 * me.realFontSize_x - me.columnScoreSize;
+
 	me.columnNameOrigin = me.realFontSize_x;
-	me.columnNameSize = 1 - 2 * me.realFontSize_x;
+	me.columnScoreOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize_x;
 }
 
 void drawListBoxItemNexuizPlayerList(entity me, float i, vector absSize, float isSelected)
 {
 	string s;
+	string score;
 	float t;
 	vector rgb;
 
@@ -107,13 +114,13 @@
 		rgb = '1 1 1';
 	
 	s = me.getPlayerList(me, i, PLAYERPARM_NAME);
+	score = me.getPlayerList(me, i, PLAYERPARM_SCORE);
 
-	if(rgb != '1 1 1')
-		s = strdecolorize(s);
+	s = draw_TextShortenToWidth(s, (me.columnNameSize / me.realFontSize_x), 1);
+	score = draw_TextShortenToWidth(score, me.columnScoreSize / me.realFontSize_x, 0);
 
-	s = draw_TextShortenToWidth(s, me.columnNameSize / me.realFontSize_x, rgb == '1 1 1');
-
-	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 1) * me.realFontSize_x)) * eX, s, me.realFontSize, rgb, 1, rgb == '1 1 1');
+	draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 1) * me.realFontSize_x)) * eX, s, me.realFontSize, '1 1 1', 1, 1);
+	draw_Text(me.realUpperMargin2 * eY + (me.columnScoreOrigin + 1.00 * (me.columnScoreSize - draw_TextWidth(score, 1) * me.realFontSize_x)) * eX, score, me.realFontSize, rgb, 1, 0);
 }
 
 #endif

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2009-01-31 09:48:43 UTC (rev 5701)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2009-01-31 11:15:59 UTC (rev 5702)
@@ -528,6 +528,9 @@
 	if (self.weaponentity.state != WS_READY)
 		return FALSE;
 	self.weaponentity.state = WS_INUSE;
+
+	self.spawnshieldtime = min(self.spawnshieldtime, time); // kill spawn shield when you fire
+
 	// if the weapon hasn't been firing continuously, reset the timer
 	if(attacktime >= 0)
 	{




More information about the nexuiz-commits mailing list