]> git.xonotic.org Git - xonotic/gmqcc.git/blob - testsuite/fields1/main.qc
Fixing some indentation
[xonotic/gmqcc.git] / testsuite / fields1 / main.qc
1 void(string, ...) print = #1;
2 string(float)     ftos  = #2;
3 entity()          spawn = #3;
4 string(vector)    vtos  = #5;
5 void(string, ...) error = #6;
6
7 entity self;
8
9 .vector origin;
10 .vector view;
11
12 entity() make = {
13     local entity e;
14     e = spawn();
15     e.view = '0 0 25';
16     return e;
17 };
18
19 float(entity targ) visible = {
20     local vector spot1, spot2;
21     spot1 = self.origin + self.view;
22     spot2 = targ.origin + targ.view;
23
24     print("spot1 = ", vtos(spot1), "\n");
25     print("spot2 = ", vtos(spot2), "\n");
26     // This was part of some QC code which had a bug
27     // we don't actually return anything important here.
28     return 0;
29 };
30
31 void(vector a, vector b) main = {
32     local entity targ;
33
34     self = make();
35     targ = make();
36     if (self == targ)
37         error("ERROR, self == targ\n");
38
39     self.origin = a;
40     targ.origin = b;
41
42     print("vis: ", ftos(visible(targ)), "\n");
43 };