]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/subs.qc
Fix compile
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / subs.qc
index 1595b9a9cf3b2824bae35f8422a32f7383c2ef09..67eb18a6782b84f54abedd8813e258c51b846fb4 100644 (file)
@@ -1,3 +1,4 @@
+#include "subs.qh"
 void SUB_NullThink(entity this) { }
 
 void SUB_CalcMoveDone(entity this);
@@ -14,7 +15,7 @@ Applies some friction to this
 void SUB_Friction (entity this)
 {
        this.SUB_NEXTTHINK = time;
-       if(this.SUB_FLAGS & FL_ONGROUND)
+       if(IS_ONGROUND(this))
                this.SUB_VELOCITY = this.SUB_VELOCITY * (1 - frametime * this.friction);
 }
 
@@ -40,7 +41,7 @@ void SUB_VanishOrRemove (entity ent)
        else
        {
                // remove
-               remove (ent);
+               delete (ent);
        }
 }
 
@@ -144,8 +145,8 @@ void SUB_CalcMove_controller_think (entity this)
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
                entity own = this.owner;
                SUB_THINK(own, this.think1);
-               remove(this);
-               WITHSELF(own, SUB_THUNK(own)(own));
+               delete(this);
+               SUB_THUNK(own)(own);
        }
 }
 
@@ -189,7 +190,7 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
        entity controller;
 
        if (!tspeed)
-               objerror ("No speed is defined!");
+               objerror (this, "No speed is defined!");
 
        this.think1 = func;
        this.finaldest = tdest;
@@ -236,7 +237,7 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
        this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
 
        // invoke controller
-       WITHSELF(controller, getthink(controller)(controller));
+       getthink(controller)(controller);
 }
 
 void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
@@ -245,7 +246,7 @@ void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, vo
        float   traveltime;
 
        if (!tspeed)
-               objerror ("No speed is defined!");
+               objerror (this, "No speed is defined!");
 
        this.think1 = func;
        this.finaldest = tdest;
@@ -320,7 +321,7 @@ void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float t
        float   traveltime;
 
        if (!tspeed)
-               objerror ("No speed is defined!");
+               objerror (this, "No speed is defined!");
 
        // take the shortest distance for the angles
        this.angles_x -= 360 * floor((this.angles_x - destangle_x) / 360 + 0.5);