globals
unit tempUnit //for passing to the enum
group enumGrp = CreateGroup() //global groups rock
endglobals
function SimpleWindowEnumFilter takes nothing returns boolean
return Acos(Cos(GetUnitFacing(tempUnit)*bj_DEGTORAD-Atan2(GetUnitY(GetFilterUnit()) - GetUnitY(tempUnit),GetUnitX(GetFilterUnit()) - GetUnitX(tempUnit)))) <= bj_PI/2
endfunction
function SimpleWindowEnum takes nothing returns nothing
set tempUnit = //your unit
call GroupEnumUnitsInRange(enumGrp,GetUnitX(tempUnit),GetUnitY(tempUnit),<enum range>,Filter(function SomeWindowEnumFilter))
endfunction