Units matching returns a UNIT GROUPE and unless you destroy the groupe it WILL leak and the map WILL then lag in under 60 seconds due to leaking.Set UnitGroup_VAR = Units matching ((Matching unit) has an item of type (YOURITEMTYPE)) Equal
@Dr Super Good: Since he uses a unit group variable, there is no group that has to be destroyed.
Waldbär said:Donut gave you a complete description of the trigger which is needed - and reading it here, I don't know why this should not work.
UnitGroup_VAR should be a unit group variable you have to create in the variables window (just click on the "x" in the trigger editor, "add" in the appearing window and choose unit group as type and a enter a name of your choice).
Did you really try it out this way?
@Dr Super Good: Since he uses a unit group variable, there is no group that has to be destroyed. The rest is leaking a little, too, but if this "ability" is not used very often, this should be negligible.
function ForGroupBJ takes group whichGroup, code callback returns nothing
// 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
call ForGroup(whichGroup, callback)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(whichGroup)
endif
endfunction