[nexuiz-commits] r7805 - in branches/nexuiz-2.0: . data data/qcsrc/client data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Sep 15 05:44:32 EDT 2009


Author: div0
Date: 2009-09-15 05:44:32 -0400 (Tue, 15 Sep 2009)
New Revision: 7805

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/qcsrc/client/View.qc
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
Log:
r7787 | div0 | 2009-09-14 10:57:53 -0400 (Mon, 14 Sep 2009) | 2 lines
sideways friction: make negative values never decrease velocity
r7788 | fruitiex | 2009-09-14 11:44:04 -0400 (Mon, 14 Sep 2009) | 2 lines
add units support to cl_showspeed and bump up the scale for the acceleration meter to make it more useful
r7795 | div0 | 2009-09-15 04:25:30 -0400 (Tue, 15 Sep 2009) | 2 lines
trueaim: do a no-world trace for the rifle so shots aren't adjusted in vain when shooting through walls
r7796 | div0 | 2009-09-15 04:28:49 -0400 (Tue, 15 Sep 2009) | 2 lines
matching clientside changes for trueaim
r7797 | div0 | 2009-09-15 04:33:15 -0400 (Tue, 15 Sep 2009) | 2 lines
fix typo
r7798 | div0 | 2009-09-15 04:35:39 -0400 (Tue, 15 Sep 2009) | 2 lines
another typo :(
r7799 | div0 | 2009-09-15 04:58:47 -0400 (Tue, 15 Sep 2009) | 2 lines
fix hit contents mask attempt


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-09-15 09:41:52 UTC (rev 7804)
+++ branches/nexuiz-2.0/.patchsets	2009-09-15 09:44:32 UTC (rev 7805)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-7563,7565-7586,7589-7589,7592-7592,7595-7595,7597-7597,7599-7602,7605-7610,7612-7615,7619-7620,7623-7623,7626-7628,7630-7630,7644-7651,7656-7656,7658-7660,7663-7665,7670-7670,7672-7676,7678-7680,7686-7687,7689-7698,7701-7701,7703-7714,7717-7723,7731-7731,7735-7741,7744-7745,7752-7754,7756-7758,7761-7764,7771-7773,7775-7775,7778-7778,7781-7785
+revisions_applied = 1-7563,7565-7586,7589-7589,7592-7592,7595-7595,7597-7597,7599-7602,7605-7610,7612-7615,7619-7620,7623-7623,7626-7628,7630-7630,7644-7651,7656-7656,7658-7660,7663-7665,7670-7670,7672-7676,7678-7680,7686-7687,7689-7698,7701-7701,7703-7714,7717-7723,7731-7731,7735-7741,7744-7745,7752-7754,7756-7758,7761-7764,7771-7773,7775-7775,7778-7778,7781-7785,7787-7788,7795-7799

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-09-15 09:41:52 UTC (rev 7804)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-09-15 09:44:32 UTC (rev 7805)
@@ -1578,7 +1578,7 @@
 seta cl_showpressedkeys	0	"Show which movement keys someone is pressing: 1 for spectating, 2 for always"
 seta cl_showpressedkeys_position "0.5 0.8"	"1 0 would be upper right corner, 0.5 0.5 the center"
 
-seta cl_showspeed 0 "show the XY speed of the player"
+seta cl_showspeed 0 "show the XY speed of the player, number selects unit (1 = qu/s (no postfix), 2 = qu/s, 3 = m/s, 4 = km/h, 5 = mph, 6 = knots)"
 seta cl_showspeed_z 0 "include the speed on the Z-axis"
 seta cl_showspeed_size 30 "size of the numbers"
 seta cl_showspeed_position 0.7 "Y-axis positioning of the numbers"
@@ -1586,7 +1586,7 @@
 seta cl_showacceleration 0 "show the XY acceleration of the player"
 seta cl_showacceleration_z 0 "include the speed on the Z-axis"
 seta cl_showacceleration_size 40 "height of the bar"
-seta cl_showacceleration_scale 1 "X-axis scale of the bar"
+seta cl_showacceleration_scale 10 "X-axis scale of the bar"
 seta cl_showacceleration_alpha 0.5 "alpha of the bar"
 seta cl_showacceleration_color_custom 0 "0 = dynamic color depending on acceleration, 1 = use custom color"
 seta cl_showacceleration_color "1 0 0" "color of the bar, needs cl_showacceleration_color_custom to be 1"

Modified: branches/nexuiz-2.0/data/qcsrc/client/View.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-09-15 09:41:52 UTC (rev 7804)
+++ branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-09-15 09:44:32 UTC (rev 7805)
@@ -209,6 +209,7 @@
 
 vector wcross_origin;
 entity trueaim;
+entity trueaim_rifle;
 
 #define SHOTTYPE_HITTEAM 1
 #define SHOTTYPE_HITOBSTRUCTION 2
@@ -220,6 +221,9 @@
 	trueaim = spawn();
 	trueaim.classname = "trueaim";
 	trueaim.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+	trueaim_rifle = spawn();
+	trueaim_rifle.classname = "trueaim_rifle";
+	trueaim_rifle.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 }
 
 float EnemyHitCheck()
@@ -275,7 +279,10 @@
 
 	vecs = decompressShotOrigin(getstati(STAT_SHOTORG));
 
-	traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, trueaim);
+	if(activeweapon == WEP_CAMPINGRIFLE)
+		traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, trueaim_rifle);
+	else
+		traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, trueaim);
 	trueaimpoint = trace_endpos;
 
 	if(vecs_x > 0)

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-09-15 09:41:52 UTC (rev 7804)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-09-15 09:44:32 UTC (rev 7805)
@@ -1937,17 +1937,45 @@
 void Sbar_ShowSpeed(void)
 {
 	vector numsize;
-	float pos;
-	string speed;
+	float pos, conversion_factor;
+	string speed, unit;
 
+	switch(cvar("cl_showspeed"))
+	{
+		default:
+		case 1:
+			unit = "";
+			conversion_factor = 1.0;
+			break;
+		case 2:
+			unit = " qu/s";
+			conversion_factor = 1.0;
+			break;
+		case 3:
+			unit = " m/s";
+			conversion_factor = 0.0254;
+			break;
+		case 4:
+			unit = " km/h";
+			conversion_factor = 0.0254 * 3.6;
+			break;
+		case 5:
+			unit = " mph";
+			conversion_factor = 0.0254 * 3.6 * 0.6213711922;
+			break;
+		case 6:
+			unit = " knots";
+			conversion_factor = 0.0254 * 1.943844492; // 1 m/s = 1.943844492 knots, because 1 knot = 1.852 km/h
+			break;
+	}
+
 	if (cvar("cl_showspeed_z") == 1)
-		speed = ftos(floor(vlen(pmove_vel) + 0.5));
+		speed = strcat(ftos(floor( vlen(pmove_vel) * conversion_factor + 0.5 )), unit);
 	else
-		speed = ftos(floor(vlen(pmove_vel - pmove_vel_z * '0 0 1') + 0.5));
+		speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit);
 
-	pos = cvar("cl_showspeed_position");
 	numsize_x = numsize_y = cvar("cl_showspeed_size");
-	pos = (vid_conheight - numsize_y) * pos;
+	pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
 	
 	drawfont = sbar_bigfont;
 	drawstringcenter('1 0 0' + pos * '0 1 0', speed, numsize, '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2009-09-15 09:41:52 UTC (rev 7804)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2009-09-15 09:44:32 UTC (rev 7805)
@@ -417,7 +417,10 @@
 	float vel_z;
 	vector vel_perpend;
 	float addspeed;
+	float savespeed;
 
+	savespeed = self.velocity * self.velocity;
+
 	vel_straight = self.velocity * wishdir;
 	vel_z = self.velocity_z;
 	vel_perpend = self.velocity - vel_straight * wishdir - vel_z * '0 0 1';
@@ -428,7 +431,18 @@
 	if(wishspeed > 0)
 		vel_straight = vel_straight + min(wishspeed, accel * frametime * wishspeed) * (1 - accelqw);
 
-	vel_perpend = vel_perpend * (1 - frametime * wishspeed * sidefric);
+	if(sidefric < 0 && (vel_perpend*vel_perpend))
+	{
+		float f, fmin;
+		f = (1 + frametime * wishspeed * sidefric);
+		fmin = (savespeed - vel_straight*vel_straight) / (vel_perpend*vel_perpend);
+		if(fmin <= 0)
+			vel_perpend = vel_perpend * f;
+		else
+			vel_perpend = vel_perpend * min(1, max(fmin, f));
+	}
+	else
+		vel_perpend = vel_perpend * (1 - frametime * wishspeed * sidefric);
 
 	self.velocity = vel_straight * wishdir + vel_z * '0 0 1' + vel_perpend;
 }

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2009-09-15 09:41:52 UTC (rev 7804)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2009-09-15 09:44:32 UTC (rev 7805)
@@ -131,17 +131,26 @@
 	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;
+	if(ent.weapon == WEP_CAMPINGRIFLE)
+		ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+	else
+		ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
+	if(antilag)
+		traceline_antilag(world, ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent));
+		// passing world, because we do NOT want it to touch dphitcontentsmask
+	else
+		traceline(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, ent);
 	ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
-	traceline(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + v_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, ent); // no antilag needed
 	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