~GaLs~
† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
- Reaction score
- 180
JASS:
private function Act takes nothing returns nothing
local location loc = GetSpellTargetLoc()
local BlackHole bh
if GetSpellAbilityId() == SPELL_ID then
set bh = BlackHole.create(GetSpellAbilityUnit(),GetLocationX(loc),GetLocationY(loc))
endif
call RemoveLocation(loc)
set loc = null
endfunction
//===========================================================================
function InitTrig_BlackHoleJass takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction( t, function Act)
endfunction
This is a part of my code, and I'm sure you don't need other parts of it. The problem only at this point, the function Act.
As you saw, I am clearing leak at the end of the function call RemoveLocation(loc).
Everytime I tested the game, just after the game loaded, I got an error message reads RemoveLocation(null) at function bla_bla_bla_Act.
I know this means I am call RemoveLocation on a nulled variable, but it isn't.