]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/fieldfuncs.qc
add another test that we just didn't have anywhere else yet
[xonotic/gmqcc.git] / tests / fieldfuncs.qc
diff --git a/tests/fieldfuncs.qc b/tests/fieldfuncs.qc
new file mode 100644 (file)
index 0000000..4228f33
--- /dev/null
@@ -0,0 +1,13 @@
+.float field;
+
+.float getfield() {
+  return field;
+}
+
+void() main = {
+  entity e = spawn();
+  e.field = 42;
+  print(ftos(e.(getfield())), "\n");
+  .float memptr = getfield();
+  print(ftos(e.memptr), "\n");
+}