From 1ba77fbc2070c3463eb4814cbc61ec13a102e335 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 11 Jul 2019 21:43:13 -0700 Subject: [PATCH] hotcoldclue: Display npc location before using device Closes runelite/runelite#9219 --- .../cluescrolls/clues/HotColdClue.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java index 219916d240..e28ee82b9e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java @@ -62,14 +62,17 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat private static final int HOT_COLD_PANEL_WIDTH = 200; private static final HotColdClue BEGINNER_CLUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Reldo may have a clue.", "Reldo", - "Speak to Reldo to receive a strange device."); + "Speak to Reldo to receive a strange device.", + new WorldPoint(3211, 3494, 0)); private static final HotColdClue MASTER_CLUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Jorral may have a clue.", "Jorral", - "Speak to Jorral to receive a strange device."); + "Speak to Jorral to receive a strange device.", + new WorldPoint(2436, 3347, 0)); private final String text; private final String npc; private final String solution; + private final WorldPoint npcLocation; @Nullable private HotColdSolver hotColdSolver; private WorldPoint location; @@ -90,11 +93,12 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat return null; } - private HotColdClue(String text, String npc, String solution) + private HotColdClue(String text, String npc, String solution, WorldPoint npcLocation) { this.text = text; this.npc = npc; this.solution = solution; + this.npcLocation = npcLocation; setRequiresSpade(true); initializeSolver(); } @@ -107,7 +111,14 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat return new WorldPoint[0]; } - return hotColdSolver.getPossibleLocations().stream().map(HotColdLocation::getWorldPoint).toArray(WorldPoint[]::new); + if (hotColdSolver.getLastWorldPoint() == null) + { + return new WorldPoint[] {npcLocation}; + } + else + { + return hotColdSolver.getPossibleLocations().stream().map(HotColdLocation::getWorldPoint).toArray(WorldPoint[]::new); + } } @Override