]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - data/frames.qc
calls for now use store_value since we don't properly deal with its liferange yet...
[xonotic/gmqcc.git] / data / frames.qc
index 9534f4af831f2110baff8bde6cef9cde465abc67..4e8e2193ba78dccae1245fb690c4ecd48a582819 100644 (file)
@@ -9,7 +9,7 @@ entity()            spawn  = #3;
 void(entity)        kill   = #4;
 
 $frame stand1 stand2 standX
-
+/*
 .float  frame;
 .float  nextthink;
 .void() think;
@@ -20,11 +20,10 @@ float  time;
 void() stand2;
 
 void() stand1 = [ 0, stand2 ] {
-    /* expands to:
-    self.frame = 0;
-    self.nextthink = time + 0.1;
-    self.think = stand2
-    */
+    // expands to:
+    //self.frame = 0;
+    //self.nextthink = time + 0.1;
+    //self.think = stand2
     print("In stand 1...\n");
     print3("--> self.frame should be 0, is ", ftos(self.frame), "\n");
 };
@@ -34,6 +33,13 @@ void() stand2 = [ 1, stand1 ] {
     print3("--> self.frame should be 1, is ", ftos(self.frame), "\n");
 };
 
+void() standm = {
+    print3("Foo ", ftos(self), "\n");
+    self.frame = 0;
+    self.nextthink = time + 0.1;
+    self.think = stand2;
+};
+
 void() main = {
     self = spawn();
 
@@ -43,7 +49,28 @@ void() main = {
     self.think = stand1;
 
     print("Running think\n");
+    standm();
+    print("Running from 'self'\n");
     self.think();
     self.think();
     self.think();
 };
+*/
+
+entity self;
+
+.float frame;
+.float nextthink;
+
+void(float a, float b) foo = {};
+
+void() main = {
+    self = spawn();
+    self.frame = 1;
+    self.nextthink = 2;
+    print2(ftos(self.frame), "\n");
+    print2(ftos(self.nextthink), "\n");
+    foo(self.frame, self.nextthink);
+    kill(self);
+};
+