]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/steerlib.qc
Merge branch 'TimePath/global_self' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / steerlib.qc
index e57d56dd169be0022cd881bc00d32e581f8e5842..fcdbda97768906734e5b468a007357b87061d825 100644 (file)
@@ -9,7 +9,7 @@
     Uniform pull towards a point
 **/
 vector steerlib_pull(vector point)
-{
+{SELFPARAM();
     return normalize(point - self.origin);
 }
 
@@ -27,7 +27,7 @@ vector steerlib_push(vector point)
     Pull toward a point, The further away, the stronger the pull.
 **/
 vector steerlib_arrive(vector point,float maximal_distance)
-{
+{SELFPARAM();
     float distance;
     vector direction;
 
@@ -40,7 +40,7 @@ vector steerlib_arrive(vector point,float maximal_distance)
     Pull toward a point increasing the pull the closer we get
 **/
 vector steerlib_attract(vector point, float maximal_distance)
-{
+{SELFPARAM();
     float distance;
     vector direction;
 
@@ -51,7 +51,7 @@ vector steerlib_attract(vector point, float maximal_distance)
 }
 
 vector steerlib_attract2(vector point, float min_influense,float max_distance,float max_influense)
-{
+{SELFPARAM();
     float distance;
     vector direction;
     float influense;
@@ -99,7 +99,7 @@ vector steerlib_attract2(vector point, float maximal_distance,float min_influens
     Move away from a point.
 **/
 vector steerlib_repell(vector point,float maximal_distance)
-{
+{SELFPARAM();
     float distance;
     vector direction;
 
@@ -113,7 +113,7 @@ vector steerlib_repell(vector point,float maximal_distance)
     Try to keep at ideal_distance away from point
 **/
 vector steerlib_standoff(vector point,float ideal_distance)
-{
+{SELFPARAM();
     float distance;
     vector direction;
 
@@ -140,7 +140,7 @@ vector steerlib_standoff(vector point,float ideal_distance)
     where range is the cicrle radius and tresh is how close we need to be to pick a new heading.
 **/
 vector steerlib_wander(float range,float tresh,vector oldpoint)
-{
+{SELFPARAM();
     vector wander_point;
     wander_point = v_forward - oldpoint;
 
@@ -159,7 +159,7 @@ vector steerlib_wander(float range,float tresh,vector oldpoint)
     Dodge a point. dont work to well.
 **/
 vector steerlib_dodge(vector point,vector dodge_dir,float min_distance)
-{
+{SELFPARAM();
     float distance;
 
     distance = max(vlen(self.origin - point),min_distance);
@@ -175,7 +175,7 @@ vector steerlib_dodge(vector point,vector dodge_dir,float min_distance)
 **/
 .float flock_id;
 vector steerlib_flock(float _radius, float standoff,float separation_force,float flock_force)
-{
+{SELFPARAM();
     entity flock_member;
     vector push = '0 0 0', pull = '0 0 0';
     float ccount = 0;
@@ -201,7 +201,7 @@ vector steerlib_flock(float _radius, float standoff,float separation_force,float
     xy only version (for ground movers).
 **/
 vector steerlib_flock2d(float _radius, float standoff,float separation_force,float flock_force)
-{
+{SELFPARAM();
     entity flock_member;
     vector push = '0 0 0', pull = '0 0 0';
     float ccount = 0;
@@ -232,7 +232,7 @@ vector steerlib_flock2d(float _radius, float standoff,float separation_force,flo
     This results in a aligned movement (?!) much like flocking.
 **/
 vector steerlib_swarm(float _radius, float standoff,float separation_force,float swarm_force)
-{
+{SELFPARAM();
     entity swarm_member;
     vector force = '0 0 0', center = '0 0 0';
     float ccount = 0;
@@ -262,7 +262,7 @@ vector steerlib_swarm(float _radius, float standoff,float separation_force,float
     You need to call makevectors() (or equivalent) before this function to set v_forward and v_right
 **/
 vector steerlib_traceavoid(float pitch,float length)
-{
+{SELFPARAM();
     vector vup_left,vup_right,vdown_left,vdown_right;
     float fup_left,fup_right,fdown_left,fdown_right;
     vector upwish,downwish,leftwish,rightwish;
@@ -309,7 +309,7 @@ vector steerlib_traceavoid(float pitch,float length)
     Run tracelines in a forward trident, bias each direction negative if something is found there.
 **/
 vector steerlib_traceavoid_flat(float pitch, float length, vector vofs)
-{
+{SELFPARAM();
     vector vt_left, vt_right,vt_front;
     float f_left, f_right,f_front;
     vector leftwish, rightwish,frontwish, v_left;
@@ -381,7 +381,7 @@ float beamsweep_badpoint(vector point,float waterok)
 
 //#define BEAMSTEER_VISUAL
 float beamsweep(vector from, vector dir,float length, float step,float step_up, float step_down)
-{
+{SELFPARAM();
     float i;
     vector a,b,u,d;
 
@@ -421,7 +421,7 @@ float beamsweep(vector from, vector dir,float length, float step,float step_up,
 }
 
 vector steerlib_beamsteer(vector dir, float length, float step, float step_up, float step_down)
-{
+{SELFPARAM();
     float bm_forward, bm_right, bm_left,p;
     vector vr,vl;
 
@@ -497,7 +497,7 @@ vector steerlib_beamsteer(vector dir, float length, float step, float step_up, f
 //#define TLIBS_TETSLIBS
 #ifdef TLIBS_TETSLIBS
 void flocker_die()
-{
+{SELFPARAM();
        Send_Effect(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
 
     self.owner.cnt += 1;
@@ -509,7 +509,7 @@ void flocker_die()
 
 
 void flocker_think()
-{
+{SELFPARAM();
     vector dodgemove,swarmmove;
     vector reprellmove,wandermove,newmove;
 
@@ -547,7 +547,7 @@ void flocker_think()
 
 
 void spawn_flocker()
-{
+{SELFPARAM();
     entity flocker;
 
     flocker = spawn ();
@@ -574,7 +574,7 @@ void spawn_flocker()
 }
 
 void flockerspawn_think()
-{
+{SELFPARAM();
 
 
     if(self.cnt > 0)
@@ -585,7 +585,7 @@ void flockerspawn_think()
 }
 
 void flocker_hunter_think()
-{
+{SELFPARAM();
     vector dodgemove,attractmove,newmove;
     entity e,ee;
     float d,bd;
@@ -640,7 +640,7 @@ void flocker_hunter_think()
 
 float globflockcnt;
 void spawnfunc_flockerspawn()
-{
+{SELFPARAM();
     precache_model ( "models/turrets/rocket.md3");
     precache_model("models/turrets/c512.md3");
     ++globflockcnt;