cluescroll plugin: Clear stale location clue hint arrows

Location clue scrolls added a hint arrow when the player was nearby one
of the clue's locations. It did not, however clear that arrow if the
locations were changed and the previously-set hint arrow location was no
longer marked. This commit updates this behavior to clear the active
hint arrow each game tick before re-adding any location hint arrows.
(and if no NPC hint arrows are set)

Fixes runelite/runelite#10370
This commit is contained in:
Jordan Atwood
2020-01-26 22:18:23 -08:00
committed by Adam
parent 86d8bd9d1a
commit 9e560d91e3
2 changed files with 110 additions and 5 deletions

View File

@@ -396,14 +396,17 @@ public class ClueScrollPlugin extends Plugin
if (clue instanceof LocationClueScroll)
{
final WorldPoint[] locations = ((LocationClueScroll) clue).getLocations();
final boolean npcHintArrowMarked = client.getHintArrowNpc() != null && npcsToMark.contains(client.getHintArrowNpc());
if (!npcHintArrowMarked)
{
client.clearHintArrow();
}
for (WorldPoint location : locations)
{
// Only set the location hint arrow if we do not already have more accurate location
if (location.isInScene(client)
&& config.displayHintArrows()
&& (client.getHintArrowNpc() == null
|| !npcsToMark.contains(client.getHintArrowNpc())))
if (location.isInScene(client) && config.displayHintArrows() && !npcHintArrowMarked)
{
client.setHintArrow(location);
}