Quote:
|
Originally Posted by TheGreatCheese
I previously posted on this topic a few weeks ago, i was wondering if there was a way to find the collision of a unit? Help would be rewarded 
|
hmm... well... There is a way, but it would be really ugly. What you could do is have a place on your map with pathable and nonpathable next to eachother and then create a unit at a pathable place (the closest pathable place to the non-pathable) and then check if his location is the same as the location you had put him on:
Code:
function IsLocPathableForUnit takes integer unitid, location where returns boolean
local unit pathing
local location checkpoint
set pathing = CreateUnitAtLoc(Player(14), unitid, where, 0)
set checkpoint = GetUnitLoc(pathing)
if GetLocationX(checkpoint) == GetLocationX(where) and GetLocationY(checkpoint) == GetLocationY(where) then
call RemoveUnit(pathing)
call RemoveLocation(checkpoint)
set pathing = null
set checkpoint = null
return true
endif
call RemoveUnit(pathing)
call RemoveLocation(checkpoint)
set pathing = null
set checkpoint = null
return false
endfunction
if you know a little jass u might understand this and change it yourself. Anyway... the easiest way it to just put all in variables.