clintbellanger/flare-engine — pull request #663 by RyanDansie (2013-05-08 21:08:23+00:00)
Title: "Next best" pathfinding results

In the case that the pathfinding target cant be reached, map a path to the "next best" position. The next best tile is the tile which is closest to the target, out of all of the tiles checked during pathfinding.

This is not a fix for https://github.com/clintbellanger/flare-engine/issues/658 and doesn't offer any performance improvement. It just gives more intelligent pathfinding behaviour when the target cant be reached. Rather than run into a wall or a river bank, the entity will use a path which takes them closer to the target.