I used this enumeration function, but it always prints "no!", doesn't matter whether there are enemys/allys w/e in range.
In cause of that the first if is never true :/
Any mistakes I made?
JASS:
function notally takes nothing returns boolean
local AI d = AI[udg_ut]
if GetEnumUnit() == null then
call CreateTextTagUnitBJ("no!", d.unit, 10.0,10.0, 100.0,100.0,100.0,0.0)
endif
if IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(udg_ut)) == false then
call IssuePointOrder(d.unit, "move", d.newPointX, d.newPointY)
elseif d.square > 1000.0 then
call IssuePointOrder(d.unit, "move", d.newPointX, d.newPointY)
endif
return false
endfunction
In cause of that the first if is never true :/
Any mistakes I made?