]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
Step 6: complete
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index cc4d2c60d69da5900d4b87113aa9f75fbdb459d3..d4463f6939531ef7da9561b4c3afa082a4237dc9 100644 (file)
@@ -234,8 +234,8 @@ vector findbetterlocation (vector org, float mindist)
        return org;
 }
 
-float LOD_customize()
-{SELFPARAM();
+float LOD_customize(entity this)
+{
        if(autocvar_loddebug)
        {
                int d = autocvar_loddebug;
@@ -260,8 +260,8 @@ float LOD_customize()
        return true;
 }
 
-void LOD_uncustomize()
-{SELFPARAM();
+void LOD_uncustomize(entity this)
+{
        this.modelindex = this.lodmodelindex0;
 }
 
@@ -326,8 +326,8 @@ void LODmodel_attach(entity this)
 }
 
 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) +
@@ -352,43 +352,43 @@ void ApplyMinMaxScaleAngles(entity e)
                setsize(e, e.mins, e.maxs);
 }
 
-void SetBrushEntityModel()
-{SELFPARAM();
-       if(self.model != "")
+void SetBrushEntityModel(entity this)
+{
+       if(this.model != "")
        {
-               precache_model(self.model);
-               if(self.mins != '0 0 0' || self.maxs != '0 0 0')
+               precache_model(this.model);
+               if(this.mins != '0 0 0' || this.maxs != '0 0 0')
                {
-                       vector mi = self.mins;
-                       vector ma = self.maxs;
-                       _setmodel(self, self.model); // no precision needed
-                       setsize(self, mi, ma);
+                       vector mi = this.mins;
+                       vector ma = this.maxs;
+                       _setmodel(this, this.model); // no precision needed
+                       setsize(this, mi, ma);
                }
                else
-                       _setmodel(self, self.model); // no precision needed
-               InitializeEntity(self, LODmodel_attach, INITPRIO_FINDTARGET);
+                       _setmodel(this, this.model); // no precision needed
+               InitializeEntity(this, LODmodel_attach, INITPRIO_FINDTARGET);
        }
-       setorigin(self, self.origin);
-       ApplyMinMaxScaleAngles(self);
+       setorigin(this, this.origin);
+       ApplyMinMaxScaleAngles(this);
 }
 
-void SetBrushEntityModelNoLOD()
-{SELFPARAM();
-       if(self.model != "")
+void SetBrushEntityModelNoLOD(entity this)
+{
+       if(this.model != "")
        {
-               precache_model(self.model);
-               if(self.mins != '0 0 0' || self.maxs != '0 0 0')
+               precache_model(this.model);
+               if(this.mins != '0 0 0' || this.maxs != '0 0 0')
                {
-                       vector mi = self.mins;
-                       vector ma = self.maxs;
-                       _setmodel(self, self.model); // no precision needed
-                       setsize(self, mi, ma);
+                       vector mi = this.mins;
+                       vector ma = this.maxs;
+                       _setmodel(this, this.model); // no precision needed
+                       setsize(this, mi, ma);
                }
                else
-                       _setmodel(self, self.model); // no precision needed
+                       _setmodel(this, this.model); // no precision needed
        }
-       setorigin(self, self.origin);
-       ApplyMinMaxScaleAngles(self);
+       setorigin(this, this.origin);
+       ApplyMinMaxScaleAngles(this);
 }
 
 /*
@@ -410,28 +410,28 @@ void SetMovedir(entity this)
        this.angles = '0 0 0';
 }
 
-void InitTrigger()
-{SELFPARAM();
+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;
-       SetBrushEntityModel();
-       self.movetype = MOVETYPE_NONE;
-       self.modelindex = 0;
-       self.model = "";
+       SetMovedir(this);
+       this.solid = SOLID_TRIGGER;
+       SetBrushEntityModel(this);
+       this.movetype = MOVETYPE_NONE;
+       this.modelindex = 0;
+       this.model = "";
 }
 
-void InitSolidBSPTrigger()
-{SELFPARAM();
+void InitSolidBSPTrigger(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_BSP;
-       SetBrushEntityModel();
-       self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
-//     self.modelindex = 0;
-       self.model = "";
+       SetMovedir(this);
+       this.solid = SOLID_BSP;
+       SetBrushEntityModel(this);
+       this.movetype = MOVETYPE_NONE; // why was this PUSH? -div0
+//     this.modelindex = 0;
+       this.model = "";
 }
 
 bool InitMovingBrushTrigger(entity this)
@@ -439,11 +439,11 @@ bool InitMovingBrushTrigger(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.
        this.solid = SOLID_BSP;
-       WITHSELF(this, SetBrushEntityModel());
+       SetBrushEntityModel(this);
        this.movetype = MOVETYPE_PUSH;
        if(this.modelindex == 0)
        {
-               objerror("InitMovingBrushTrigger: no brushes found!");
+               objerror(this, "InitMovingBrushTrigger: no brushes found!");
                return false;
        }
        return true;