why do u need the int vairable when u can just check when the group is emptY?
I'm nitpicking here, but using an integer to count the amount of units in a group is way faster.
function IsUnitGroupEmptyBJEnum takes nothing returns nothing
set bj_isUnitGroupEmptyResult = false
endfunction
function IsUnitGroupEmptyBJ 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_isUnitGroupEmptyResult = true
call ForGroup(g, function IsUnitGroupEmptyBJEnum)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(g)
endif
return bj_isUnitGroupEmptyResult
endfunction
function Trig_Melee_Initialization_Conditions takes nothing returns boolean
if ( not ( IsUnitGroupEmptyBJ(Group) == true ) ) then
return false
endif
return true
endfunction
function CountUnitsInGroupEnum takes nothing returns nothing
set bj_groupCountUnits = bj_groupCountUnits + 1
endfunction
function CountUnitsInGroup takes group g returns integer
// 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_groupCountUnits = 0
call ForGroup(g, function CountUnitsInGroupEnum)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(g)
endif
return bj_groupCountUnits
endfunction
function Trig_Melee_Initialization_Conditions takes nothing returns boolean
if ( not ( CountUnitsInGroup(Group) == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Melee_Initialization_Conditions takes nothing returns boolean
if ( not ( udg_unitsInGroup == 0 ) ) then
return false
endif
return true
endfunction