Fixed a Bug

The pathfinding algorithm would under certain circumstances travel
alongside the sides of the map to reach its destination.