EdgeOfChaos
E
EdgeOfChaos
This is always a really annoying error since it makes it so you can't use any code type in a Struct. This is a very simple workaround for it that at least lets you save and execute code in an array. If there's any better workaround I'd love to hear it, since I have to use a code array in a map I'm making:
Of course it won't let you use it as a code for an enumerator function or something like that...
JASS:
struct Code
/**
* Used to store the code internally
* Code will be added as an action to
* this trigger, then executed as a trigger
* when called.
*/
private trigger t
public static method create takes code c returns thistype
local thistype new = thistype.allocate()
set new.t = CreateTrigger()
call TriggerAddAction(new.t,c)
return new
endmethod
public method destroy takes nothing returns nothing
call DestroyTrigger(t)
set t = null
endmethod
public method execute takes nothing returns nothing
call TriggerExecute(t)
endmethod
endstruct