I feel a bit stupid and ignorant after retiring from mapping for so long, so more noobish questions from me =)
Q1:
IsUnitGroupDeadBJ from 1.24 blizzard.j:
As you can see IsUnitGroupDeadBJ will leak if bj_wantDestroyGroup is set to false, which is the default value defined in blizzard.j. So do I need to set bj_wantDestroyGroup to true manually in map initialization trigger?
Q2:
Does DestroyGroup a null unitgroup have any side effect?
I asked because the variable I am passing to DestroyGroup might be null
Thanks.
Q1:
IsUnitGroupDeadBJ from 1.24 blizzard.j:
Code:
// Memory cleanup vars
boolean bj_wantDestroyGroup = false
function IsUnitGroupDeadBJEnum takes nothing returns nothing
if not IsUnitDeadBJ(GetEnumUnit()) then
set bj_isUnitGroupDeadResult = false
endif
endfunction
//===========================================================================
// Returns true if every unit of the group is dead.
//
function IsUnitGroupDeadBJ takes group g returns boolean
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
set bj_isUnitGroupDeadResult = true
call ForGroup(g, function IsUnitGroupDeadBJEnum)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(g)
endif
return bj_isUnitGroupDeadResult
endfunction
As you can see IsUnitGroupDeadBJ will leak if bj_wantDestroyGroup is set to false, which is the default value defined in blizzard.j. So do I need to set bj_wantDestroyGroup to true manually in map initialization trigger?
Q2:
Does DestroyGroup a null unitgroup have any side effect?
I asked because the variable I am passing to DestroyGroup might be null
Thanks.