PhaseCoder 0 Share Posted November 26, 2018 Like the title says. I have looked in #getViewPort && #client#viewporttools Link to comment Share on other sites More sharing options...
Hashtag 8671 Share Posted November 26, 2018 getMap().canReach Link to comment Share on other sites More sharing options...
PhaseCoder 0 Author Share Posted November 26, 2018 fdoohh after i dug up some old sources lol public int pathLengthTo(final Tile dest, final boolean isObject) { final Tile curPos = Data.getMyPlayer().getTile(); return pathLengthBetween(curPos, dest, isObject); } public int pathLengthBetween(final Tile start, final Tile dest, final boolean isObject) { return dijkstraDist(start.getX() - getClient().getBaseX(), // startX start.getY() - getClient().getBaseY(), // startY dest.getX() - getClient().getBaseX(), // destX dest.getY() - getClient().getBaseY(), // destY isObject); // if it's an object, accept any adjacent tile } public boolean canReach(final Tile dest, final boolean isObject) { return pathLengthTo(dest, isObject) != -1; } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.