waaaks!
Zinctified
- Reaction score
- 256
I'm having problems on how to attach a struct to something and retrieve the struct in a condition function from a GroupEnum filter function
JASS:
function filt takes nothing returns boolean
local myStruct d = ?? // how will I retrieve myStruct?
local unit u = GetFilterUnit()
call UnitDamageTarget(d.c,u,40,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
return false //The Group will not be filled because the function returns false, instead this function will loop through the units
endfunction
function bla takes nothing returns nothing
local group g = NewGroup()
local myStruct d = myStruct.create()
local real x = 0.0
local real y = 0.0
set d.c = GetTriggerUnit()
call GroupEnumUnitsInRange(g,x,y,500,Condition(function filt))
//cleanups.....
endfunction