Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function verifyLoS(start, end) {
- if (start == end) return true;
- for (var i = 1; i < (round(getDistance(start, end))); i++)
- 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;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement