]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/pathlib/debug.qc
Make most server includes order insensitive
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / pathlib / debug.qc
1 #include "../pathlib.qh"
2
3 #ifdef TURRET_DEBUG
4 void mark_error(vector where,float lifetime);
5 void mark_info(vector where,float lifetime);
6 entity mark_misc(vector where,float lifetime);
7 #endif
8
9 void pathlib_showpath(entity start)
10 {
11     entity e;
12     e = start;
13     while(e.path_next)
14     {
15         te_lightning1(e,e.origin,e.path_next.origin);
16         e = e.path_next;
17     }
18 }
19
20 void path_dbg_think()
21 {
22     pathlib_showpath(self);
23     self.nextthink = time + 1;
24 }
25
26 void __showpath2_think()
27 {
28     #ifdef TURRET_DEBUG
29         mark_info(self.origin,1);
30         #endif
31     if(self.path_next)
32     {
33         self.path_next.think     = __showpath2_think;
34         self.path_next.nextthink = time + 0.15;
35     }
36     else
37     {
38         self.owner.think     = __showpath2_think;
39         self.owner.nextthink = time + 0.15;
40     }
41 }
42
43 void pathlib_showpath2(entity path)
44 {
45     path.think     = __showpath2_think;
46     path.nextthink = time;
47 }
48
49
50 void pathlib_showsquare2(entity node ,vector ncolor,float align)
51 {
52
53     node.alpha     = 0.25;
54     node.scale     = pathlib_gridsize / 512.001;
55     node.solid     = SOLID_NOT;
56
57     setmodel(node,"models/pathlib/square.md3");
58     setorigin(node,node.origin);
59     node.colormod = ncolor;
60
61     if(align)
62     {
63         traceline(node.origin + '0 0 32', node.origin - '0 0 128', MOVE_WORLDONLY, node);
64         node.angles = vectoangles(trace_plane_normal);
65         node.angles_x -= 90;
66     }
67 }
68
69 void SUB_Remove();
70
71 void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
72 {
73     entity s;
74
75     if(!_lifetime)
76         _lifetime = time + 30;
77     else
78         _lifetime += time;
79
80     s           = spawn();
81     s.alpha     = 0.25;
82     s.think     = SUB_Remove;
83     s.nextthink = _lifetime;
84     s.scale     = pathlib_gridsize / 512.001;
85     s.solid     = SOLID_NOT;
86
87     if(goodsquare)
88         setmodel(s,"models/pathlib/goodsquare.md3");
89     else
90         setmodel(s,"models/pathlib/badsquare.md3");
91
92
93
94     traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,s);
95
96     s.angles = vectoangles(trace_plane_normal);
97     s.angles_x -= 90;
98     setorigin(s,where);
99 }
100
101 void pathlib_showedge(vector where,float _lifetime,float rot)
102 {
103     entity e;
104
105     if(!_lifetime)
106         _lifetime = time + 30;
107     else
108         _lifetime += time;
109
110     e           = spawn();
111     e.alpha     = 0.25;
112     e.think     = SUB_Remove;
113     e.nextthink = _lifetime;
114     e.scale     = pathlib_gridsize / 512;
115     e.solid     = SOLID_NOT;
116     setorigin(e,where);
117     setmodel(e,"models/pathlib/edge.md3");
118     //traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,e);
119     //e.angles = vectoangles(trace_plane_normal);
120     e.angles_y = rot;
121     //e.angles_x += 90;
122
123 }