- Joined
- Dec 29, 2006
- Messages
- 994
Ok, I made this code is JASS and i was wondering if it will leak or not
JASS:
function Trig_Chain_Lightning_Caster_no_leak_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetAttacker()) == 'hC36' ) )
endfunction
function Trig_Chain_Lightning_Caster_no_leak_Actions takes nothing returns nothing
set udg_TempLoc = GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc( 1, 'h00I', GetOwningPlayer(GetAttacker()), udg_TempLoc, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'ACcl', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", GetAttackedUnitBJ() )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
set TempLoc = null
endfunction
//===========================================================================
function InitTrig_Chain_Lightning_Caster_no_leak takes nothing returns nothing
set gg_trg_Chain_Lightning_Caster_no_leak = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chain_Lightning_Caster_no_leak, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Chain_Lightning_Caster_no_leak, Condition( function Trig_Chain_Lightning_Caster_no_leak_Conditions ) )
call TriggerAddAction( gg_trg_Chain_Lightning_Caster_no_leak, function Trig_Chain_Lightning_Caster_no_leak_Actions )
endfunction