//============================================================================================================
//
// For more JASS scripts, visit us at http://www.wc3JASS.com
//
//============================================================================================================
function IsLocPathable takes location l returns boolean
local real x = GetLocationX(l)
local real y = GetLocationY(l)
local real ad = ((GetCameraBoundMaxX()+GetCameraMargin(CAMERA_MARGIN_RIGHT)) - (GetCameraBoundMinX()-GetCameraMargin(CAMERA_MARGIN_LEFT))) / 720
local unit u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'odoc',x,y,0)
call ShowUnit(u,false)
call UnitAddAbility(u,'Aeye')
if (GetUnitX(u) > x + ad) or (GetUnitX(u) < x - ad) or (GetUnitY(u) > y + ad) or (GetUnitY(u) < y - ad) then
call RemoveUnit(u)
return false
elseif IssuePointOrder(u,"evileye",x,y) then
call RemoveUnit(u)
return true
endif
call RemoveUnit(u)
return false
endfunction