code: private void checkPathfinderChanges()
      {
          if (pathFoundChanged)
          {
              if (currentStep < getMaxStep())
              {
                  removeObjectId(path.getX(currentStep), path.getY(currentStep));
              }
              if (path != null)
              {
                  path.clear();
              }
              path = pathfinder.findPath(this, destX, destY, false);
              pathFoundChanged = false;
              currentStep = 0;
              skip = false;
              reCheckRef = false;
  
              if (path == null)
              {
                  pathStoppedRequested = true;
              }
          }
          if (pathStoppedRequested)
          {
              pathStopped = true;
              pathStoppedRequested = false;
              onArrived();
          }
      }
docs: Check if pathfinder changed.