Skip to content

Commit

Permalink
Remove overlapping line guidance (#1832)
Browse files Browse the repository at this point in the history
* fix: Only use shortest path if no linepoints defined

Generally line points are used if there's a special route to take, so should be prioritised.

* fix: Add checks for goal points in removeShortestPath

* fix: Check for linePoints being assigned in shortest path

* fix: cleanup isLineDrawn check for shortest-path
  • Loading branch information
Zoinkwiz authored Nov 18, 2024
1 parent 8485023 commit e87c8a1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/com/questhelper/steps/DetailedQuestStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ protected boolean isActionForRequiredItem(MenuEntry entry)
@Override
public void setShortestPath()
{
if (worldPoint != null)
if (worldPoint != null && !isLineDrawn())
{
WorldPoint playerWp = client.getLocalPlayer().getWorldLocation();
if (getQuestHelper().getConfig().useShortestPath() && playerWp != null) {
Expand All @@ -923,7 +923,7 @@ public void setShortestPath()
@Override
public void removeShortestPath()
{
if (getQuestHelper().getConfig().useShortestPath())
if (getQuestHelper().getConfig().useShortestPath() && worldPoint != null && !isLineDrawn())
{
eventBus.post(new PluginMessage("shortestpath", "clear"));
}
Expand All @@ -932,9 +932,14 @@ public void removeShortestPath()
@Override
public void disableShortestPath()
{
if (worldPoint != null)
if (worldPoint != null && !isLineDrawn())
{
eventBus.post(new PluginMessage("shortestpath", "clear"));
}
}

private boolean isLineDrawn()
{
return linePoints != null && !linePoints.isEmpty();
}
}

0 comments on commit e87c8a1

Please sign in to comment.