[nexuiz-commits] r8094 - in trunk/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Oct 11 07:33:31 EDT 2009
Author: div0
Date: 2009-10-11 07:33:31 -0400 (Sun, 11 Oct 2009)
New Revision: 8094
Modified:
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/server/cl_weaponsystem.qc
Log:
show aiming direction on player models using a REALLY stupid way (cvar controlled)
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-10-11 10:48:30 UTC (rev 8093)
+++ trunk/data/defaultNexuiz.cfg 2009-10-11 11:33:31 UTC (rev 8094)
@@ -1655,4 +1655,7 @@
r_shadow_shadowmapping 1
+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 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 10:48:30 UTC (rev 8093)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc 2009-10-11 11:33:31 UTC (rev 8094)
@@ -737,6 +737,7 @@
void CL_ExteriorWeaponentity_Think()
{
float tag_found;
+ vector ang;
self.nextthink = time;
if (self.owner.exteriorweaponentity != self)
{
@@ -777,6 +778,26 @@
else
self.alpha = 1;
+ ang_x = bound(cvar("sv_pitch_min"), self.owner.v_angle_x, cvar("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
+
self.colormap = self.owner.colormap;
};
More information about the nexuiz-commits
mailing list