mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-31 12:00:38 +00:00
fields: testing function-fields
This commit is contained in:
parent
b421c42d4b
commit
cb2f89e5bb
1 changed files with 11 additions and 0 deletions
|
@ -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)();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue