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