]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_subs.qc
Clean up mapobjects' includes a little bit, move some subs around
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_subs.qc
index 21c43ea1059a87b10a5a454ebc76b6e09f23331c..dbbd6d2b4dff76bdf68888a05847f851a759563a 100644 (file)
@@ -8,11 +8,6 @@
 #include "../lib/warpzone/common.qh"
 #include "../common/mapobjects/subs.qh"
 
-spawnfunc(info_null)
-{
-       delete(this);
-       // if anything breaks, tell the mapper to fix his map! info_null is meant to remove itself immediately.
-}
 
 /*
 ==================
@@ -313,127 +308,3 @@ void LODmodel_attach(entity this)
                if (!getSendEntity(this))
                        SetCustomizer(this, LOD_customize, LOD_uncustomize);
 }
-
-void ApplyMinMaxScaleAngles(entity e)
-{
-       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) +
-                       '0 1 0' * max(-e.mins.y, e.maxs.y) +
-                       '0 0 1' * max(-e.mins.z, e.maxs.z)
-               );
-               e.mins = -e.maxs;
-       }
-       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) +
-                       '0 1 0' * max(-e.mins.y, e.maxs.y)
-               );
-               e.maxs_y = e.maxs.x;
-               e.mins_x = -e.maxs.x;
-               e.mins_y = -e.maxs.x;
-       }
-       if(e.scale)
-               setsize(e, e.mins * e.scale, e.maxs * e.scale);
-       else
-               setsize(e, e.mins, e.maxs);
-}
-
-void SetBrushEntityModel(entity this)
-{
-       if(this.model != "")
-       {
-               precache_model(this.model);
-               if(this.mins != '0 0 0' || this.maxs != '0 0 0')
-               {
-                       vector mi = this.mins;
-                       vector ma = this.maxs;
-                       _setmodel(this, this.model); // no precision needed
-                       setsize(this, mi, ma);
-               }
-               else
-                       _setmodel(this, this.model); // no precision needed
-               InitializeEntity(this, LODmodel_attach, INITPRIO_FINDTARGET);
-       }
-       setorigin(this, this.origin);
-       ApplyMinMaxScaleAngles(this);
-}
-
-void SetBrushEntityModelNoLOD(entity this)
-{
-       if(this.model != "")
-       {
-               precache_model(this.model);
-               if(this.mins != '0 0 0' || this.maxs != '0 0 0')
-               {
-                       vector mi = this.mins;
-                       vector ma = this.maxs;
-                       _setmodel(this, this.model); // no precision needed
-                       setsize(this, mi, ma);
-               }
-               else
-                       _setmodel(this, this.model); // no precision needed
-       }
-       setorigin(this, this.origin);
-       ApplyMinMaxScaleAngles(this);
-}
-
-/*
-================
-InitTrigger
-================
-*/
-
-void SetMovedir(entity this)
-{
-       if(this.movedir != '0 0 0')
-               this.movedir = normalize(this.movedir);
-       else
-       {
-               makevectors(this.angles);
-               this.movedir = v_forward;
-       }
-
-       this.angles = '0 0 0';
-}
-
-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(this);
-       this.solid = SOLID_TRIGGER;
-       SetBrushEntityModel(this);
-       set_movetype(this, MOVETYPE_NONE);
-       this.modelindex = 0;
-       this.model = "";
-}
-
-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(this);
-       this.solid = SOLID_BSP;
-       SetBrushEntityModel(this);
-       set_movetype(this, MOVETYPE_NONE); // why was this PUSH? -div0
-//     this.modelindex = 0;
-       this.model = "";
-}
-
-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;
-       SetBrushEntityModel(this);
-       set_movetype(this, MOVETYPE_PUSH);
-       if(this.modelindex == 0)
-       {
-               objerror(this, "InitMovingBrushTrigger: no brushes found!");
-               return false;
-       }
-       return true;
-}