code: private int updateNeighbour(Pathfindable mover, int dtx, int dty, Node current, int xp, int yp, int maxDepth)
      {
          int nextDepth = maxDepth;
          final double nextStepCost = current.getCost() + getMovementCost(mover, current.getX(), current.getY());
          final Node neighbour = nodes[yp][xp];
  
          if (nextStepCost < neighbour.getCost())
          {
              open.remove(neighbour);
              closed.remove(neighbour);
          }
          if (!open.contains(neighbour) && !closed.contains(neighbour))
          {
              neighbour.setCost(nextStepCost);
              neighbour.setHeuristic(getHeuristicCost(xp, yp, dtx, dty));
              nextDepth = Math.max(maxDepth, neighbour.setParent(current));
              open.add(neighbour);
          }
          return nextDepth;
      }
docs: Update the current neighbor on search.
  
  @param mover The entity that will be moving along the path.
  @param dtx The x coordinate of the destination location.
  @param dty The y coordinate of the destination location.
  @param current The current node.
  @param xp The x coordinate of the destination location.
  @param yp The y coordinate of the destination location.
  @param maxDepth The last max depth.
  @return The next max depth.