]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/debug.qc
Merge branch 'master' into Mario/fullbright_skins
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / debug.qc
index 4f73b24733bcbf75714a07a33db840cb4e9bc8b6..0a350df2c2f467f4ed03958639fd31607b7dd133 100644 (file)
@@ -1,3 +1,10 @@
+#include "debug.qh"
+#include "pathlib.qh"
+
+MODEL(SQUARE,       "models/pathlib/square.md3");
+MODEL(SQUARE_GOOD,  "models/pathlib/goodsquare.md3");
+MODEL(SQUARE_BAD,   "models/pathlib/badsquare.md3");
+MODEL(EDGE,         "models/pathlib/edge.md3");
 
 #ifdef TURRET_DEBUG
 void mark_error(vector where,float lifetime);
@@ -16,36 +23,35 @@ void pathlib_showpath(entity start)
     }
 }
 
-void path_dbg_think()
+void path_dbg_think(entity this)
 {
-    pathlib_showpath(self);
-    self.nextthink = time + 1;
+    pathlib_showpath(this);
+    this.nextthink = time + 1;
 }
 
-void __showpath2_think()
+void __showpath2_think(entity this)
 {
     #ifdef TURRET_DEBUG
-       mark_info(self.origin,1);
+       mark_info(this.origin,1);
        #endif
-    if(self.path_next)
+    if(this.path_next)
     {
-        self.path_next.think     = __showpath2_think;
-        self.path_next.nextthink = time + 0.15;
+        setthink(this.path_next, __showpath2_think);
+        this.path_next.nextthink = time + 0.15;
     }
     else
     {
-        self.owner.think     = __showpath2_think;
-        self.owner.nextthink = time + 0.15;
+        setthink(this.owner, __showpath2_think);
+        this.owner.nextthink = time + 0.15;
     }
 }
 
 void pathlib_showpath2(entity path)
 {
-    path.think     = __showpath2_think;
+    setthink(path, __showpath2_think);
     path.nextthink = time;
 }
 
-
 void pathlib_showsquare2(entity node ,vector ncolor,float align)
 {
 
@@ -53,8 +59,8 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align)
     node.scale     = pathlib_gridsize / 512.001;
     node.solid     = SOLID_NOT;
 
-    setmodel(node,"models/pathlib/square.md3");
-    setorigin(node,node.origin);
+    setmodel(node, MDL_SQUARE);
+    setorigin(node, node.origin);
     node.colormod = ncolor;
 
     if(align)
@@ -76,23 +82,18 @@ void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 
     s           = spawn();
     s.alpha     = 0.25;
-    s.think     = SUB_Remove;
+    setthink(s, SUB_Remove);
     s.nextthink = _lifetime;
     s.scale     = pathlib_gridsize / 512.001;
     s.solid     = SOLID_NOT;
 
-    if(goodsquare)
-        setmodel(s,"models/pathlib/goodsquare.md3");
-    else
-        setmodel(s,"models/pathlib/badsquare.md3");
-
-
+    setmodel(s, goodsquare ? MDL_SQUARE_GOOD : MDL_SQUARE_BAD);
 
     traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,s);
 
     s.angles = vectoangles(trace_plane_normal);
     s.angles_x -= 90;
-    setorigin(s,where);
+    setorigin(s, where);
 }
 
 void pathlib_showedge(vector where,float _lifetime,float rot)
@@ -106,12 +107,12 @@ void pathlib_showedge(vector where,float _lifetime,float rot)
 
     e           = spawn();
     e.alpha     = 0.25;
-    e.think     = SUB_Remove;
+    setthink(e, SUB_Remove);
     e.nextthink = _lifetime;
     e.scale     = pathlib_gridsize / 512;
     e.solid     = SOLID_NOT;
-    setorigin(e,where);
-    setmodel(e,"models/pathlib/edge.md3");
+    setorigin(e, where);
+    setmodel(e, MDL_EDGE);
     //traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,e);
     //e.angles = vectoangles(trace_plane_normal);
     e.angles_y = rot;