diff --git a/src/main/java/com/questhelper/steps/DetailedQuestStep.java b/src/main/java/com/questhelper/steps/DetailedQuestStep.java index b2b65b977f..b21670cd2d 100644 --- a/src/main/java/com/questhelper/steps/DetailedQuestStep.java +++ b/src/main/java/com/questhelper/steps/DetailedQuestStep.java @@ -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) { @@ -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")); } @@ -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(); + } }