tgstation/-tg-station — pull request #3719 by Perakp (2014-05-16 20:54:53+00:00)
Title: Fixes stinging from range pathfinding

- Fixes Astar pathfinding being stupid with maxnodes
- Diagonal movement now costs whatever sqrt(2) rounds to.
- Fixes #3665

The problem was giving non-zero maxnodes cut (arbitrarily) the last item from the 'open' node list, where all nodes needed to be gone through. This was broken especially when maxnodes was smaller than the amount of adjacent turfs. Because Astar gives (or atleast should in theory give) the shortest path, it is sufficient to check if the length of this path is bigger than what we wanted it to be.