+#include "subs.qh"
void SUB_NullThink(entity this) { }
void SUB_CalcMoveDone(entity 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);
}
else
{
// remove
- remove (ent);
+ delete (ent);
}
}
// 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);
}
}
entity controller;
if (!tspeed)
- objerror ("No speed is defined!");
+ objerror (this, "No speed is defined!");
this.think1 = func;
this.finaldest = tdest;
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)
float traveltime;
if (!tspeed)
- objerror ("No speed is defined!");
+ objerror (this, "No speed is defined!");
this.think1 = func;
this.finaldest = tdest;
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);