Replaced pathfinding mess, added friendly mode