Advertisement
pierrotdu18

Untitled

Aug 21st, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function verifyLoS(start, end) {
  2.     if (start == end) return true;
  3.     for (var i = 1; i < (round(getDistance(start, end))); i++)
  4.         if(!isEmptyCell(getCellFromXY(round(getCellX(start) + ((getCellX(end) - getCellX(start))/(round(getDistance(start, end)))) * i), round(getCellY(start) + ((getCellY(end) - getCellY(start))/(round(getDistance(start, end)))) * i)))) return false;
  5.     return true;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement