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