]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
data/fields.qc now tests fieldpointer parameters - requires -std=qcc to build
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:39:43 +0000 (16:39 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 16 Aug 2012 14:39:43 +0000 (16:39 +0200)
data/fields.qc

index dde80e1d955f214cd544a62c4f604bba7301c739..379f4287f7ff70eaf8cb6285962b11df9cbe2e50 100644 (file)
@@ -12,11 +12,8 @@ void(entity)        kill   = #4;
 .float memb;
 .vector memv;
 
-//void(entity a, .float f) printfield = {
-//    print3("The field is ", ftos(a.f), "\n");
-//};
-void(entity x) foo = {
-    print2(ftos(x.mema),"\n");
+void(entity a, .float f) printfield = {
+    print3("The field is ", ftos(a.f), "\n");
 };
 
 void() main = {
@@ -37,5 +34,5 @@ void() main = {
     print3("x = ", ftos(pawn.memv_x), "\n");
     print3("y = ", ftos(pawn.memv_y), "\n");
     print3("z = ", ftos(pawn.memv_z), "\n");
-    foo(pawn);
+    printfield(pawn, memv_z);
 };