Hello,
I wonder if there is a way to pass struct methods as function code it TriggerAddAction(). There is an example:
This syntaxe doesn't work, because real name of this method is something like s__someStruct_structMethod, but
doesn't work either, because methods automaticaly requres integer paramether "this" and function must not take any arguments when used as code.
Any solutions???
I wonder if there is a way to pass struct methods as function code it TriggerAddAction(). There is an example:
JASS:
struct someStruct
local trackable track
method structMethod takes nothing returns nothing
// do some stuff here
endmethod
method structInit takes nothing returns nothing
local trigger t = CreateTrigger()
set this.track = someRandomTrack // just an example
call TriggerRegisterTrackableHitEvent(t, track)
call TriggerAddAction(t, function this.structMethod)
endmethod
endstruct
This syntaxe doesn't work, because real name of this method is something like s__someStruct_structMethod, but
JASS:
call TriggerAddAction(t, function s__someStruct_structMethod)
doesn't work either, because methods automaticaly requres integer paramether "this" and function must not take any arguments when used as code.
Any solutions???