short gz = (short) z;
int gtx = tx - L2World.MAP_MIN_X >> 4;
int gty = ty - L2World.MAP_MIN_Y >> 4;
short gtz = (short) tz;
Node start = readNode(gx, gy, gz);
Node end = readNode(gtx, gty, gtz);
if(start == null || end == null)
return null;
if(Math.abs(start.getZ() - z) > 55)
return null; // not correct layer
if(Math.abs(end.getZ() - tz) > 55)
return null; // not correct layer
if(start.equals(end))
return null;
// TODO: Find closest path node we CAN access. Now only checks if we can not reach the closest
Location temp = GeoData.getInstance().moveCheck(x, y, z, start.getX(), start.getY(), start.getZ());
if(temp.getX() != start.getX() || temp.getY() != start.getY())
return null; // cannot reach closest...
// TODO: Find closest path node around target, now only checks if final location can be reached
temp = GeoData.getInstance().moveCheck(tx, ty, tz, end.getX(), end.getY(), end.getZ());
if(temp.getX() != end.getX() || temp.getY() != end.getY())
return null; // cannot reach closest...
//return searchAStar(start, end);
return searchByClosest2(start, end);
}