local unit u = ... // parameter
call TriggerAddAction(trg, function SomeFunc)
call SetHandleHandle(trg, "LABEL", u)
function SomeFunc takes nothing returns nothing
local trigger trg = GetTriggeringTrigger()
local unit u = GetHandleUnit(trg, "LABEL")
// Use u here..
endfunction
When a unit dies (or decays) run FlushHandleLocals with the dying unit. Like this:
call FlushHandleLocals(GetDyingUnit())
That cleans up the references (but not the objects). Likewise, before destroying a handle, also call FlushHandleLocals with that so you don't leave any unnecissary entries in the gamecache.
If you are using a gg_trg_ trigger, you won't need DestroyTrigger. If it is created on the fly, and you only want it to execute once, destroy it when it has executed. Like this:
Hmm... it doesn't seem to work into the spell I am making... Did you type the code correctly? I don't need to change anything about Handle stuff? I have no idea bout them...
vicky2004Those are Vexorians function Kattana!A true JASS cripter shouldn't use his Caster System!
Handle vars are kattana's , but the auto flushing thing is mine.
Handle vars are everyone's.
And the thing you said, no offense but that's stupid, utility functions exist for a reason, so true JASS scripters don't have to make stuff that was already done by other people so they have more time to make stuff that was not done yet.