From cb2f89e5bba20f1c2eddd07fb5c1eb4f6d8f85b2 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Sat, 18 Aug 2012 14:50:30 +0200 Subject: [PATCH] fields: testing function-fields --- data/fields.qc | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)(); }; -- 2.39.2