- Joined
- Sep 25, 2013
- Messages
- 6
Hi Hivers, few questions here,
1.) From the code above, does the Timer leaks? if it's, how can i remove the leaks?
2.) Can i use a local Timer instead of declaring a global timer? does it leaks?
3.) Does this use of Timer fully MUI? it only run two times when three unit cast.
4.) From the code above, should i nullify or destroy the local trigger to prevent leaks?
5.) Why people use local trigger instead of gg_trg_triggername?
6.) Does TriggerAddCondition better then TriggerAddAction? why people use condition function as action instead of adding a boolean expression in it?
JASS:
scope blah initializer Init
globals
private timer t
endglobals
private function timeOut takes nothing returns nothing
call BJDebugMsg("blah blah blah")
call DestroyTimer(t)
endfunction
private function cond takes nothing returns boolean
if GetSpellAbilityId() == 'A000' then
set t = CreateTimer()
call TimerStart(t, 3., false, function timeOut)
endif
return false
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, function cond )
endfunction
endscope
1.) From the code above, does the Timer leaks? if it's, how can i remove the leaks?
2.) Can i use a local Timer instead of declaring a global timer? does it leaks?
3.) Does this use of Timer fully MUI? it only run two times when three unit cast.
4.) From the code above, should i nullify or destroy the local trigger to prevent leaks?
5.) Why people use local trigger instead of gg_trg_triggername?
6.) Does TriggerAddCondition better then TriggerAddAction? why people use condition function as action instead of adding a boolean expression in it?