]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/debug.qc
Merge branch 'terencehill/slider_drag_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / debug.qc
index 64ce9da0289b935cb96f71f88ca7b25d2b0b0ee2..434f50b8641bcb3aeeb3f8a76efc1e0ee17c4b13 100644 (file)
@@ -1,3 +1,9 @@
+#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);
@@ -17,14 +23,14 @@ void pathlib_showpath(entity start)
 }
 
 void path_dbg_think()
-{
+{SELFPARAM();
     pathlib_showpath(self);
     self.nextthink = time + 1;
 }
 
 void __showpath2_think()
-{
-    #ifdef TURRET_DEBUG 
+{SELFPARAM();
+    #ifdef TURRET_DEBUG
        mark_info(self.origin,1);
        #endif
     if(self.path_next)
@@ -45,7 +51,6 @@ void pathlib_showpath2(entity path)
     path.nextthink = time;
 }
 
-
 void pathlib_showsquare2(entity node ,vector ncolor,float align)
 {
 
@@ -53,7 +58,7 @@ 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");
+    setmodel(node, MDL_SQUARE);
     setorigin(node,node.origin);
     node.colormod = ncolor;
 
@@ -65,28 +70,25 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align)
     }
 }
 
-void pathlib_showsquare(vector where,float goodsquare,float lifetime)
+void SUB_Remove();
+
+void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 {
     entity s;
 
-    if(!lifetime)
-        lifetime = time + 30;
+    if(!_lifetime)
+        _lifetime = time + 30;
     else
-        lifetime += time;
+        _lifetime += time;
 
     s           = spawn();
     s.alpha     = 0.25;
     s.think     = SUB_Remove;
-    s.nextthink = lifetime;
+    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);
 
@@ -95,23 +97,23 @@ void pathlib_showsquare(vector where,float goodsquare,float lifetime)
     setorigin(s,where);
 }
 
-void pathlib_showedge(vector where,float lifetime,float rot)
+void pathlib_showedge(vector where,float _lifetime,float rot)
 {
     entity e;
 
-    if(!lifetime)
-        lifetime = time + 30;
+    if(!_lifetime)
+        _lifetime = time + 30;
     else
-        lifetime += time;
+        _lifetime += time;
 
     e           = spawn();
     e.alpha     = 0.25;
     e.think     = SUB_Remove;
-    e.nextthink = lifetime;
+    e.nextthink = _lifetime;
     e.scale     = pathlib_gridsize / 512;
     e.solid     = SOLID_NOT;
     setorigin(e,where);
-    setmodel(e,"models/pathlib/edge.md3");
+    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;