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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Oct 11 07:36:06 EDT 2009


Author: div0
Date: 2009-10-11 07:36:06 -0400 (Sun, 11 Oct 2009)
New Revision: 8095

Modified:
   trunk/data/defaultNexuiz.cfg
   trunk/data/qcsrc/server/cl_weaponsystem.qc
   trunk/data/qcsrc/server/miscfunctions.qc
Log:
make a cvar control the model sanity fix


Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg	2009-10-11 11:33:31 UTC (rev 8094)
+++ trunk/data/defaultNexuiz.cfg	2009-10-11 11:36:06 UTC (rev 8095)
@@ -1657,5 +1657,6 @@
 
 set sv_pitch_min -35 "minimum aiming angle for shooting direction display of the gun"
 set sv_pitch_max  35 "maximum aiming angle for shooting direction display of the gun"
+set sv_pitch_fixyaw 1 "workaround to fix the aiming direction on stupidly made player models, FIXME fix the models and set this to 0"
 
 set rescan_pending 0 "set to 1 to schedule a fs_rescan at the end of this match"

Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-10-11 11:33:31 UTC (rev 8094)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-10-11 11:36:06 UTC (rev 8095)
@@ -778,25 +778,28 @@
 	else
 		self.alpha = 1;
 
-	ang_x = bound(cvar("sv_pitch_min"), self.owner.v_angle_x, cvar("sv_pitch_max"));
+	ang_x = bound(sv_pitch_min, self.owner.v_angle_x, sv_pitch_max);
 	ang_y = 0;
 	ang_z = 0;
 
-#ifdef OUR_MODELS_ARE_SANE
-	ang_x = -/* don't ask */ang_x;
-	self.angles = ang;
-#else
-	ang_y = self.owner.v_angle_y;
-	makevectors(ang);
-	var vector v = v_forward;
-	gettaginfo(self.tag_entity, self.tag_index);
-	// untransform v according to this coordinate space
-	vector w;
-	w_x = v_forward * v;
-	w_y = -v_right * v;
-	w_z = v_up * v;
-	self.angles = vectoangles(w);
-#endif
+	if(sv_pitch_fixyaw) // workaround for stupid player models that don't aim forward
+	{
+		ang_y = self.owner.v_angle_y;
+		makevectors(ang);
+		var vector v = v_forward;
+		gettaginfo(self.tag_entity, self.tag_index);
+		// untransform v according to this coordinate space
+		vector w;
+		w_x = v_forward * v;
+		w_y = -v_right * v;
+		w_z = v_up * v;
+		self.angles = vectoangles(w);
+	}
+	else
+	{
+		ang_x = -/* don't ask */ang_x;
+		self.angles = ang;
+	}
 
 	self.colormap = self.owner.colormap;
 };

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2009-10-11 11:33:31 UTC (rev 8094)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2009-10-11 11:36:06 UTC (rev 8095)
@@ -1085,6 +1085,10 @@
 float sv_autotaunt;
 float sv_taunt;
 
+float sv_pitch_min;
+float sv_pitch_max;
+float sv_pitch_fixyaw;
+
 void readlevelcvars(void)
 {
     g_bugrigs = cvar("g_bugrigs");
@@ -1211,6 +1215,10 @@
     if not(inWarmupStage)
         game_starttime                 = cvar("g_start_delay");
 
+	sv_pitch_min = cvar("sv_pitch_min");
+	sv_pitch_max = cvar("sv_pitch_max");
+	sv_pitch_fixyaw = cvar("sv_pitch_fixyaw");
+
     readplayerstartcvars();
 }
 



More information about the nexuiz-commits mailing list