s3rius
Linux is only free if your time is worthless.
- Reaction score
- 130
I've copied something from Blizzard's Bomber Command and modified it for my needs. Now I'd like to ask if there are any leaks remaining (since I have no experience in removing trigger leaks)
Thanks for any help.
JASS:
function Rocket_Impact takes nothing returns nothing
local unit u= GetTriggerUnit()
call DestroyTrigger( GetTriggeringTrigger() )
//Do something
//Do something more
call RemoveUnit(u)
call RemoveUnit(GetEventDamageSource())
set u = null
endfunction
function Fire_Rocket takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit u
local unit targ
local location targloc = GetSpellTargetLoc()
local trigger trg
set u=CreateUnitAtLoc(GetOwningPlayer(c),039;n009039;, GetUnitLoc(c),GetUnitFacing(c))
set targ = CreateUnitAtLoc(GetOwningPlayer(c), 039;n00B039;, targloc, 270)
//Do some other shit
set trg = CreateTrigger()
call TriggerRegisterUnitEvent( trg, targ, EVENT_UNIT_DAMAGED )
call TriggerAddAction( trg, function Rocket_Impact )
call IssueTargetOrder( u, "thunderbolt", targ )
set c = null
set targ = null
set u=null
call RemoveLocation(targloc)
set targloc = null
set trg = null
endfunction
Thanks for any help.