]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/vecfields.qc
fix access to fields of vector members
[xonotic/gmqcc.git] / tests / vecfields.qc
diff --git a/tests/vecfields.qc b/tests/vecfields.qc
new file mode 100644 (file)
index 0000000..6cc053a
--- /dev/null
@@ -0,0 +1,13 @@
+.vector v1;
+
+float set(entity e, float v) {
+       e.v1.y = v;
+       return e.v1.y;
+}
+
+void main() {
+       entity e = spawn();
+       e.v1 = '1 2 3';
+       print(ftos(set(e, 42)), " => ");
+       print(vtos(e.v1), "\n");
+}