From e87c8a10353e38aaa14f6b917d4d535ee0dc93e6 Mon Sep 17 00:00:00 2001 From: Zoinkwiz Date: Mon, 18 Nov 2024 22:37:52 +0000 Subject: [PATCH] Remove overlapping line guidance (#1832) * 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 --- .../java/com/questhelper/steps/DetailedQuestStep.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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(); + } }