- Reaction score
- 333
Will that execute the function 'group_stuff'?
Yes, but the function will be executed as a group filter, which means it must return a boolean (use false in this case) and you must use GetFilterUnit() instead of GetEnumUnit().
Will that execute the function 'group_stuff'?
function Substitute takes nothing returns boolean
return true
endfunction
function blablabla...
local group g = CreateGroup()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local unit u
call GroupEnumUnitsInRange(g, x, y, AoE, Condition(function Substitute))
loop
set u = FirstOfGroup(g)
exitwhen u == null
if IsUnitAlly(u, GetOwningPlayer(caster)) == true and IsUnitType(u, UNIT_TYPE_STRUCTURE) != true and GetWidgetLife(u) > .405 then
//Do your actions
endif
call GroupRemoveUnit(g, u)
endloop
set hlife = 0
set glife = 0
set gx = 0
set gy = 0
JASS:function Substitute takes nothing returns boolean return true endfunction // Other stuff call GroupEnumUnitsInRange(g, x, y, AoE, Condition(function Substitute))
call GroupEnumUnitsInRange(g, x, y, AoE, null)