code: private boolean isValidLocation(Pathfindable mover, int stx, int sty, int dtx, int dty, boolean ignoreRef)
      {
          boolean invalid = dtx < 0 || dty < 0 || dtx >= map.getInTileWidth() || dty >= map.getInTileHeight();
  
          if (!invalid && (stx != dtx || sty != dty))
          {
              invalid = mapPath.isBlocked(mover, dtx, dty, ignoreRef);
          }
  
          return !invalid;
      }
docs: Check if a given location is valid for the supplied mover.
  
  @param mover The mover that would hold a given location.
  @param stx The starting x coordinate.
  @param sty The starting y coordinate.
  @param dtx The x coordinate of the location to check.
  @param dty The y coordinate of the location to check.
  @param ignoreRef The ignore map reference array checking.
  @return <code>true</code> if the location is valid for the given mover, <code>false</code> else.