From: Wolfgang (Blub) Bumiller Date: Sat, 18 Aug 2012 12:50:30 +0000 (+0200) Subject: fields: testing function-fields X-Git-Tag: 0.1-rc1~227 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cb2f89e5bba20f1c2eddd07fb5c1eb4f6d8f85b2;p=xonotic%2Fgmqcc.git fields: testing function-fields --- diff --git a/data/fields.qc b/data/fields.qc index 379f428..7c29959 100644 --- a/data/fields.qc +++ b/data/fields.qc @@ -12,10 +12,17 @@ void(entity) kill = #4; .float memb; .vector memv; +.void() fun; + void(entity a, .float f) printfield = { + ftos(3+4); print3("The field is ", ftos(a.f), "\n"); }; +void() funny = { + print("FUNNY\n"); +}; + void() main = { entity pawn; @@ -35,4 +42,8 @@ void() main = { print3("y = ", ftos(pawn.memv_y), "\n"); print3("z = ", ftos(pawn.memv_z), "\n"); printfield(pawn, memv_z); + + pawn.fun = funny; + + (pawn.fun)(); };