While standing here, if both fishing spots are up getClosest() will return this one:
While standing in the other tile, it will return the other fishing spot, causing the loop to click one spot, then click the other spot over and over. I don't want to use an isAnimating() check because the fishing animation carries on for a few ticks after the fishing spot disappears.
Is there a way to fix this issue? My fishing method:
NPC currentSpot;
Position currentLocation;
public void fish() {
NPC fishingSpot = getNpcs().closest(6825);
if(fishingSpot == null) {
log("spot == null");
return;
}
if(currentSpot == null) {
currentSpot = fishingSpot;
fishingSpot.interact("Bait");
}
if(!currentSpot.equals(fishingSpot)) {
currentSpot = fishingSpot;
fishingSpot.interact("Bait");
}
getMouse().moveOutsideScreen();
}