]> git.xonotic.org Git - xonotic/gmqcc.git/blob - data/frames.qc
Oops setting wrong members
[xonotic/gmqcc.git] / data / frames.qc
1 /* this is the WIP test for the parser...
2  * constantly adding stuff here to see if things break
3  */
4 void(string)        print  = #1;
5 void(string,string) print2 = #1;
6 void(string,string,string) print3 = #1;
7 string(float)       ftos   = #2;
8 entity()            spawn  = #3;
9 void(entity)        kill   = #4;
10
11 $frame stand1 stand2 standX
12
13 .float  frame;
14 .float  nextthink;
15 .void() think;
16
17 entity self;
18 float  time;
19
20 void() stand2;
21
22 void() stand1 = [ 0, stand2 ] {
23     /* expands to:
24     self.frame = 0;
25     self.nextthink = time + 0.1;
26     self.think = stand2
27     */
28     print("In stand 1...\n");
29     print3("--> self.frame should be 0, is ", ftos(self.frame), "\n");
30 };
31
32 void() stand2 = [ 1, stand1 ] {
33     print("In stand 2...\n");
34     print3("--> self.frame should be 1, is ", ftos(self.frame), "\n");
35 };
36
37 void() main = {
38     self = spawn();
39
40     time = 10;
41
42     print("Setting think\n");
43     self.think = stand1;
44
45     print("Running think\n");
46     self.think();
47     self.think();
48     self.think();
49 };