Added support for 8-way pathfinding.