]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
data/functions.qc for some more tests
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 17:39:48 +0000 (19:39 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 17:39:48 +0000 (19:39 +0200)
data/functions.qc [new file with mode: 0644]

diff --git a/data/functions.qc b/data/functions.qc
new file mode 100644 (file)
index 0000000..241be83
--- /dev/null
@@ -0,0 +1,29 @@
+/* this is the WIP test for the parser...
+ * constantly adding stuff here to see if things break
+ */
+void(string)        print  = #1;
+void(string,string) print2 = #1;
+void(string,string,string) print3 = #1;
+string(float)       ftos   = #2;
+entity()            spawn  = #3;
+void(entity)        kill   = #4;
+
+.float vis;
+.entity other;
+
+float(entity targ) visible = {
+    return targ.vis;
+};
+
+void() main = {
+    local entity pawn, pawn2;
+
+    pawn = spawn();
+    pawn2 = spawn();
+
+    pawn.other = pawn2;
+    (pawn.other).vis = 0;
+
+    if (!visible(pawn.other))
+        print("Yes\n");
+};