]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/pathlib/debug.qc
Extract a few more functions
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / debug.qc
index ac6249f9936365667bd50f2a9f34b5a8a8dd101c..5c97cf7ac41575adba77f604d88399f000597d95 100644 (file)
@@ -1,8 +1,10 @@
+#include "../pathlib.qh"
 
+#ifdef TURRET_DEBUG
 void mark_error(vector where,float lifetime);
 void mark_info(vector where,float lifetime);
 entity mark_misc(vector where,float lifetime);
-
+#endif
 
 void pathlib_showpath(entity start)
 {
@@ -23,7 +25,9 @@ void path_dbg_think()
 
 void __showpath2_think()
 {
-    mark_info(self.origin,1);
+    #ifdef TURRET_DEBUG
+       mark_info(self.origin,1);
+       #endif
     if(self.path_next)
     {
         self.path_next.think     = __showpath2_think;
@@ -56,25 +60,27 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align)
 
     if(align)
     {
-        traceline(node.origin + '0 0 32',node.origin - '0 0 128',MOVE_WORLDONLY,node);
+        traceline(node.origin + '0 0 32', node.origin - '0 0 128', MOVE_WORLDONLY, node);
         node.angles = vectoangles(trace_plane_normal);
         node.angles_x -= 90;
     }
 }
 
-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;
 
@@ -92,19 +98,19 @@ 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);