]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
Merge branch 'TimePath/modules'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index 2134278a2b1027c71c63e3514814c6a79c98683f..e8e50c7184134148406c439b092c96e2b5161137 100644 (file)
@@ -8,7 +8,7 @@
 
 spawnfunc(info_null)
 {
-       remove(this);
+       delete(this);
        // if anything breaks, tell the mapper to fix his map! info_null is meant to remove itself immediately.
 }
 
@@ -51,9 +51,9 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
        {
                // take players back into the past
                FOREACH_CLIENT(IS_PLAYER(it) && it != forent, antilag_takeback(it, CS(it), time - lag));
-               FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
-                       if(it != forent)
-                               antilag_takeback(it, it, time - lag);
+               IL_EACH(g_monsters, it != forent,
+               {
+                       antilag_takeback(it, it, time - lag);
                });
        }
 
@@ -67,9 +67,9 @@ void tracebox_antilag_force_wz (entity source, vector v1, vector mi, vector ma,
        if (lag)
        {
                FOREACH_CLIENT(IS_PLAYER(it) && it != forent, antilag_restore(it, CS(it)));
-               FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, {
-                       if (it != forent)
-                               antilag_restore(it, it);
+               IL_EACH(g_monsters, it != forent,
+               {
+                       antilag_restore(it, it);
                });
        }
 
@@ -141,10 +141,10 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon
 
                if(c == 50)
                {
-                       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");
+                       LOG_TRACE("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2));
+                       LOG_TRACE("  Nudging gets us nowhere at ", vtos(pos));
+                       LOG_TRACE("  trace_endpos is ", vtos(trace_endpos));
+                       LOG_TRACE("  trace distance is ", ftos(vlen(pos - trace_endpos)));
                }
 
                stopentity = trace_ent;
@@ -212,12 +212,12 @@ vector findbetterlocation (vector org, float mindist)
        c = 0;
        while (c < 6)
        {
-               traceline (org, org + vec, true, world);
+               traceline (org, org + vec, true, NULL);
                vec = vec * -1;
                if (trace_fraction < 1)
                {
                        loc = trace_endpos;
-                       traceline (loc, loc + vec, true, world);
+                       traceline (loc, loc + vec, true, NULL);
                        if (trace_fraction >= 1)
                                org = loc + vec;
                }
@@ -234,7 +234,7 @@ vector findbetterlocation (vector org, float mindist)
        return org;
 }
 
-float LOD_customize(entity this)
+bool LOD_customize(entity this, entity client)
 {
        if(autocvar_loddebug)
        {
@@ -249,10 +249,10 @@ float LOD_customize(entity this)
        }
 
        // TODO csqc network this so it only gets sent once
-       vector near_point = NearestPointOnBox(this, other.origin);
-       if(vdist(near_point - other.origin, <, this.loddistance1))
+       vector near_point = NearestPointOnBox(this, client.origin);
+       if(vdist(near_point - client.origin, <, this.loddistance1))
                this.modelindex = this.lodmodelindex0;
-       else if(!this.lodmodelindex2 || vdist(near_point - other.origin, <, this.loddistance2))
+       else if(!this.lodmodelindex2 || vdist(near_point - client.origin, <, this.loddistance2))
                this.modelindex = this.lodmodelindex1;
        else
                this.modelindex = this.lodmodelindex2;
@@ -277,20 +277,20 @@ void LODmodel_attach(entity this)
 
        if(this.lodtarget1 != "")
        {
-               e = find(world, targetname, this.lodtarget1);
+               e = find(NULL, targetname, this.lodtarget1);
                if(e)
                {
                        this.lodmodel1 = e.model;
-                       remove(e);
+                       delete(e);
                }
        }
        if(this.lodtarget2 != "")
        {
-               e = find(world, targetname, this.lodtarget2);
+               e = find(NULL, targetname, this.lodtarget2);
                if(e)
                {
                        this.lodmodel2 = e.model;
-                       remove(e);
+                       delete(e);
                }
        }
 
@@ -321,13 +321,13 @@ void LODmodel_attach(entity this)
        }
 
        if(this.lodmodelindex1)
-               if (!this.SendEntity)
+               if (!getSendEntity(this))
                        SetCustomizer(this, LOD_customize, LOD_uncustomize);
 }
 
 void ApplyMinMaxScaleAngles(entity e)
-{SELFPARAM();
-       if(e.angles.x != 0 || e.angles.z != 0 || self.avelocity.x != 0 || self.avelocity.z != 0) // "weird" rotation
+{
+       if(e.angles.x != 0 || e.angles.z != 0 || e.avelocity.x != 0 || e.avelocity.z != 0) // "weird" rotation
        {
                e.maxs = '1 1 1' * vlen(
                        '1 0 0' * max(-e.mins.x, e.maxs.x) +
@@ -336,7 +336,7 @@ void ApplyMinMaxScaleAngles(entity e)
                );
                e.mins = -e.maxs;
        }
-       else if(e.angles.y != 0 || self.avelocity.y != 0) // yaw only is a bit better
+       else if(e.angles.y != 0 || e.avelocity.y != 0) // yaw only is a bit better
        {
                e.maxs_x = vlen(
                        '1 0 0' * max(-e.mins.x, e.maxs.x) +
@@ -414,12 +414,12 @@ void InitTrigger(entity this)
 {
 // 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(self);
-       self.solid = SOLID_TRIGGER;
+       SetMovedir(this);
+       this.solid = SOLID_TRIGGER;
        SetBrushEntityModel(this);
-       self.movetype = MOVETYPE_NONE;
-       self.modelindex = 0;
-       self.model = "";
+       set_movetype(this, MOVETYPE_NONE);
+       this.modelindex = 0;
+       this.model = "";
 }
 
 void InitSolidBSPTrigger(entity this)
@@ -429,7 +429,7 @@ void InitSolidBSPTrigger(entity this)
        SetMovedir(this);
        this.solid = SOLID_BSP;
        SetBrushEntityModel(this);
-       this.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
+       set_movetype(this, MOVETYPE_NONE); // why was this PUSH? -div0
 //     this.modelindex = 0;
        this.model = "";
 }
@@ -440,10 +440,10 @@ bool InitMovingBrushTrigger(entity this)
 // to mean no restrictions, so use a yaw of 360 instead.
        this.solid = SOLID_BSP;
        SetBrushEntityModel(this);
-       this.movetype = MOVETYPE_PUSH;
+       set_movetype(this, MOVETYPE_PUSH);
        if(this.modelindex == 0)
        {
-               objerror("InitMovingBrushTrigger: no brushes found!");
+               objerror(this, "InitMovingBrushTrigger: no brushes found!");
                return false;
        }
        return true;