]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
Allow single letter uldr, also make sure it isn't case sensitive
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index eacba6452869ce4bb9c95836f1de2b28ccf356d7..41bac7a43f9d896b20ea0639e059092d6b635596 100644 (file)
@@ -1,11 +1,11 @@
 #include "g_subs.qh"
-#include "_all.qh"
 
 #include "antilag.qh"
 #include "command/common.qh"
-#include "../warpzonelib/common.qh"
+#include "../lib/warpzone/common.qh"
+#include "../common/triggers/subs.qh"
 
-void spawnfunc_info_null (void)
+spawnfunc(info_null)
 {
        remove(self);
        // if anything breaks, tell the mapper to fix his map! info_null is meant to remove itself immediately.
@@ -187,10 +187,10 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon
 
                if(c == 50)
                {
-                       dprint("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2), "\n");
-                       dprint("  Nudging gets us nowhere at ", vtos(pos), "\n");
-                       dprint("  trace_endpos is ", vtos(trace_endpos), "\n");
-                       dprint("  trace distance is ", ftos(vlen(pos - trace_endpos)), "\n");
+                       LOG_TRACE("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2), "\n");
+                       LOG_TRACE("  Nudging gets us nowhere at ", vtos(pos), "\n");
+                       LOG_TRACE("  trace_endpos is ", vtos(trace_endpos), "\n");
+                       LOG_TRACE("  trace distance is ", ftos(vlen(pos - trace_endpos)), "\n");
                }
 
                stopentity = trace_ent;
@@ -280,50 +280,8 @@ vector findbetterlocation (vector org, float mindist)
        return org;
 }
 
-/*
-==================
-crandom
-
-Returns a random number between -1.0 and 1.0
-==================
-*/
-float crandom (void)
-{
-       return 2 * (random () - 0.5);
-}
-
-/*
-==================
-Angc used for animations
-==================
-*/
-
-
-float angc (float a1, float a2)
-{
-       float   a;
-
-       while (a1 > 180)
-               a1 = a1 - 360;
-       while (a1 < -179)
-               a1 = a1 + 360;
-
-       while (a2 > 180)
-               a2 = a2 - 360;
-       while (a2 < -179)
-               a2 = a2 + 360;
-
-       a = a1 - a2;
-       while (a > 180)
-               a = a - 360;
-       while (a < -179)
-               a = a + 360;
-
-       return a;
-}
-
 float LOD_customize()
-{
+{SELFPARAM();
        float d;
 
        if(autocvar_loddebug)
@@ -351,12 +309,12 @@ float LOD_customize()
 }
 
 void LOD_uncustomize()
-{
+{SELFPARAM();
        self.modelindex = self.lodmodelindex0;
 }
 
 void LODmodel_attach()
-{
+{SELFPARAM();
        entity e;
 
        if(!self.loddistance1)
@@ -396,13 +354,13 @@ void LODmodel_attach()
                ma = self.maxs;
 
                precache_model(self.lodmodel1);
-               setmodel(self, self.lodmodel1);
+               _setmodel(self, self.lodmodel1);
                self.lodmodelindex1 = self.modelindex;
 
                if(self.lodmodel2 != "")
                {
                        precache_model(self.lodmodel2);
-                       setmodel(self, self.lodmodel2);
+                       _setmodel(self, self.lodmodel2);
                        self.lodmodelindex2 = self.modelindex;
                }
 
@@ -416,7 +374,7 @@ void LODmodel_attach()
 }
 
 void ApplyMinMaxScaleAngles(entity e)
-{
+{SELFPARAM();
        if(e.angles.x != 0 || e.angles.z != 0 || self.avelocity.x != 0 || self.avelocity.z != 0) // "weird" rotation
        {
                e.maxs = '1 1 1' * vlen(
@@ -443,7 +401,7 @@ void ApplyMinMaxScaleAngles(entity e)
 }
 
 void SetBrushEntityModel()
-{
+{SELFPARAM();
        if(self.model != "")
        {
                precache_model(self.model);
@@ -451,11 +409,11 @@ void SetBrushEntityModel()
                {
                        vector mi = self.mins;
                        vector ma = self.maxs;
-                       setmodel(self, self.model); // no precision needed
+                       _setmodel(self, self.model); // no precision needed
                        setsize(self, mi, ma);
                }
                else
-                       setmodel(self, self.model); // no precision needed
+                       _setmodel(self, self.model); // no precision needed
                InitializeEntity(self, LODmodel_attach, INITPRIO_FINDTARGET);
        }
        setorigin(self, self.origin);
@@ -463,7 +421,7 @@ void SetBrushEntityModel()
 }
 
 void SetBrushEntityModelNoLOD()
-{
+{SELFPARAM();
        if(self.model != "")
        {
                precache_model(self.model);
@@ -471,11 +429,11 @@ void SetBrushEntityModelNoLOD()
                {
                        vector mi = self.mins;
                        vector ma = self.maxs;
-                       setmodel(self, self.model); // no precision needed
+                       _setmodel(self, self.model); // no precision needed
                        setsize(self, mi, ma);
                }
                else
-                       setmodel(self, self.model); // no precision needed
+                       _setmodel(self, self.model); // no precision needed
        }
        setorigin(self, self.origin);
        ApplyMinMaxScaleAngles(self);
@@ -487,24 +445,24 @@ InitTrigger
 ================
 */
 
-void SetMovedir()
+void SetMovedir(entity this)
 {
-       if (self.movedir != '0 0 0')
-               self.movedir = normalize(self.movedir);
+       if(this.movedir != '0 0 0')
+               this.movedir = normalize(this.movedir);
        else
        {
-               makevectors (self.angles);
-               self.movedir = v_forward;
+               makevectors(this.angles);
+               this.movedir = v_forward;
        }
 
-       self.angles = '0 0 0';
+       this.angles = '0 0 0';
 }
 
 void InitTrigger()
-{
+{SELFPARAM();
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       SetMovedir ();
+       SetMovedir(self);
        self.solid = SOLID_TRIGGER;
        SetBrushEntityModel();
        self.movetype = MOVETYPE_NONE;
@@ -513,10 +471,10 @@ void InitTrigger()
 }
 
 void InitSolidBSPTrigger()
-{
+{SELFPARAM();
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
-       SetMovedir ();
+       SetMovedir(self);
        self.solid = SOLID_BSP;
        SetBrushEntityModel();
        self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
@@ -525,7 +483,7 @@ void InitSolidBSPTrigger()
 }
 
 float InitMovingBrushTrigger()
-{
+{SELFPARAM();
 // trigger angles are used for one-way touches.  An angle of 0 is assumed
 // to mean no restrictions, so use a yaw of 360 instead.
        self.solid = SOLID_BSP;