[Trigger] Is Terrain Pathable?

Status
Not open for further replies.
Level 9
Joined
May 28, 2007
Messages
365
I have an ability that ports the unit to the location. The problem is, users can abuse the ability to port people to area they can't get out of (such in-between cliffs, etc) I was wandering if anyone knew a way to check if you could move around in an area?

I tried Vexorian's function, but it doesn't seem to work... at all.
 
Level 9
Joined
May 28, 2007
Messages
365
I managed to solve my own problem with the following script:

JASS:
function IsPathable takes real x, real y returns boolean
    local unit d1 = CreateUnit( Player(13), 'hfoo', x, y, 270)
    local unit d2 = CreateUnit( Player(13), 'hfoo', x, y, 270)
    if( DistanceBetweenXY(GetUnitX(d1), GetUnitY(d1), GetUnitX(d2), GetUnitY(d2)) < 32) then
        call RemoveUnit(d1)
        call RemoveUnit(d2)
        set d1 = null
        set d2 = null
        return FALSE
    endif
    call RemoveUnit(d1)
    call RemoveUnit(d2)
    set d1 = null
    set d2 = null
    return TRUE
endfunction
 
Status
Not open for further replies.
Top