]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
Replace more `vector_[xyz]` with `vector.[xyz]`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index 63dc67c1f4fc927f90d7ba996403d580076a09c0..a7cedc80710fe6710955647e3bd486dff2ffd944 100644 (file)
@@ -1,9 +1,6 @@
-void SUB_NullThink(void) { }
+#include "g_subs.qh"
 
-void()  SUB_CalcMoveDone;
-void() SUB_CalcAngleMoveDone;
-//void() SUB_UseTargets;
-void() SUB_Remove;
+void SUB_NullThink(void) { }
 
 void spawnfunc_info_null (void)
 {
@@ -16,14 +13,14 @@ void setanim(entity e, vector anim, float looping, float override, float restart
        if (!anim)
                return; // no animation was given to us! We can't use this.
 
-       if (anim_x == e.animstate_startframe)
-       if (anim_y == e.animstate_numframes)
-       if (anim_z == e.animstate_framerate)
+       if (anim.x == e.animstate_startframe)
+       if (anim.y == e.animstate_numframes)
+       if (anim.z == e.animstate_framerate)
        {
                if(restart)
                {
                        if(restart > 0)
-                       if(anim_y == 1) // ZYM animation
+                       if(anim.y == 1) // ZYM animation
                                BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
                }
                else
@@ -49,7 +46,7 @@ void updateanim(entity e)
                        e.animstate_starttime = e.animstate_endtime;
                        e.animstate_endtime = e.animstate_starttime + e.animstate_numframes / e.animstate_framerate;
                }
-               e.animstate_override = FALSE;
+               e.animstate_override = false;
        }
        e.frame = e.animstate_startframe + bound(0, (time - e.animstate_starttime) * e.animstate_framerate, e.animstate_numframes - 1);
        //print(ftos(time), " -> ", ftos(e.frame), "\n");
@@ -74,7 +71,6 @@ SUB_Friction
 Applies some friction to self
 ==================
 */
-.float friction;
 void SUB_Friction (void)
 {
        self.nextthink = time;
@@ -152,7 +148,6 @@ void SUB_CalcMoveDone (void)
                self.think1 ();
 }
 
-.float platmovetype_turn;
 void SUB_CalcMove_controller_think (void)
 {
        entity oldself;
@@ -180,7 +175,7 @@ void SUB_CalcMove_controller_think (void)
                        vector destangle;
                        destangle = delta + 2 * delta2 * phasepos;
                        destangle = vectoangles(destangle);
-                       destangle_x = -destangle.x; // flip up / down orientation
+                       destangle.x = -destangle.x; // flip up / down orientation
 
                        // take the shortest distance for the angles
                        self.owner.angles_x -= 360 * floor((self.owner.angles.x - destangle.x) / 360 + 0.5);
@@ -236,12 +231,6 @@ void SUB_CalcMove_controller_setlinear (entity controller, vector org, vector de
        controller.destvec2 = '0 0 0';
 }
 
-float TSPEED_TIME = -1;
-float TSPEED_LINEAR = 0;
-float TSPEED_START = 1;
-float TSPEED_END = 2;
-// TODO average too?
-
 void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeedtype, float tspeed, void() func)
 {
        float   traveltime;
@@ -507,7 +496,7 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
 }
 void traceline_antilag_force (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, FALSE);
+       tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, false);
 }
 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
@@ -519,11 +508,11 @@ void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2
 {
        if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
-       tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, FALSE);
+       tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, false);
 }
 void WarpZone_traceline_antilag_force (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, TRUE);
+       tracebox_antilag_force_wz(source, v1, '0 0 0', '0 0 0', v2, nomonst, forent, lag, true);
 }
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
@@ -535,7 +524,7 @@ void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma,
 {
        if (autocvar_g_antilag != 2 || source.cvar_cl_noantilag)
                lag = 0;
-       tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, TRUE);
+       tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, true);
 }
 
 float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity) // returns the number of traces done, for benchmarking
@@ -640,21 +629,21 @@ vector findbetterlocation (vector org, float mindist)
        c = 0;
        while (c < 6)
        {
-               traceline (org, org + vec, TRUE, world);
+               traceline (org, org + vec, true, world);
                vec = vec * -1;
                if (trace_fraction < 1)
                {
                        loc = trace_endpos;
-                       traceline (loc, loc + vec, TRUE, world);
+                       traceline (loc, loc + vec, true, world);
                        if (trace_fraction >= 1)
                                org = loc + vec;
                }
                if (c & 1)
                {
                        h = vec.y;
-                       vec_y = vec.x;
-                       vec_x = vec.z;
-                       vec_z = h;
+                       vec.y = vec.x;
+                       vec.x = vec.z;
+                       vec.z = h;
                }
                c = c + 1;
        }
@@ -704,16 +693,6 @@ float angc (float a1, float a2)
        return a;
 }
 
-.string lodtarget1;
-.string lodtarget2;
-.string lodmodel1;
-.string lodmodel2;
-.float lodmodelindex0;
-.float lodmodelindex1;
-.float lodmodelindex2;
-.float loddistance1;
-.float loddistance2;
-
 float LOD_customize()
 {
        float d;
@@ -727,7 +706,7 @@ float LOD_customize()
                        self.modelindex = self.lodmodelindex1;
                else // if(d == 3)
                        self.modelindex = self.lodmodelindex2;
-               return TRUE;
+               return true;
        }
 
        // TODO csqc network this so it only gets sent once
@@ -739,7 +718,7 @@ float LOD_customize()
        else
                self.modelindex = self.lodmodelindex2;
 
-       return TRUE;
+       return true;
 }
 
 void LOD_uncustomize()