- Joined
- Feb 27, 2007
- Messages
- 5,578
I want to be able to have a user pass functions to one of my functions so that for a particular struct I can .evaluate() those functions when a certain thing happens. Some places I want to do this the next line is the .destroy() so I want to use evaluate instead of running in another thread.
But you can't have code arrays! So what do I do, make it a boolexpr? Or do I have to make it a string input for ExecuteFunc (thus forcing into another thread):
JASS:
struct s
code onUnitDeath
endfunction
//in Unit death trigger
call someS.onUnitDeath.evaluate()
call someS.destroy()
//user code:
call s.create(... , function CustomOnDeath)
But you can't have code arrays! So what do I do, make it a boolexpr? Or do I have to make it a string input for ExecuteFunc (thus forcing into another thread):
JASS:
struct s
string onUnitDeath = ""
endfunction
//in Unit death trigger
call ExecuteFunc(someS.onUnitDeath)
call someS.destroy()
//user code:
call s.create(... , "CustomOnDeath")