I've been coding most of the spells in my maps using dynamic triggers, recently I saw a post on wc3c claiming that dynamic triggers leak ever so slightly no matter how you go about cleaning them up... naturally this made me piss my pants as I would have to recode tons of spells if it happened to be true.
So just how bad are dynamic triggers?
Additionally, I have posted a sketch of how I go about cleaning up the dynamic triggers in my map:
So just how bad are dynamic triggers?
Additionally, I have posted a sketch of how I go about cleaning up the dynamic triggers in my map:
JASS:
function ability_periodic takes nothing returns nothing
local trigger trig = GetTriggeringTrigger()
local integer trigid = GetHandleId(trig)
call TriggerRemoveAction(trig, LoadTriggerActionHandle(udg_hashtable, trigid, 0))
call FlushChildHashtable(udg_hashtable, trigid)
call DisableTrigger(trig)
set trig = null
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function ability_conditions takes nothing returns boolean
local trigger trig
local integer trigid
if GetSpellAbilityId() == 'xxxx' then
set trig = CreateTrigger()
set trigid = GetHandleId(trig)
call TriggerRegisterTimerEvent(trig, 0.03125, true)
call SaveTriggerActionHandle(udg_hashtable , trigid, 0, TriggerAddAction(trig, function ability_periodic))
set trig = null
endif
return false
endfunction