From eee9a51474561a07378dbfa6ebe16a30e55085f4 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Tue, 17 Dec 2019 15:02:03 +0000 Subject: [PATCH] kourendlibrary: fix layout resetting unintentionally --- .../client/plugins/kourendlibrary/Library.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/Library.java b/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/Library.java index ea74a84b39..65a7e363bb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/Library.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/Library.java @@ -130,14 +130,12 @@ class Library } else if (state != SolvedState.NO_DATA) { - // We know all of the possible things in this shelf. - if (book != null || bookcase.getPossibleBooks().stream().noneMatch(Book::isDarkManuscript)) + // Reset if the book we found isn't what we expected + // Reset if we found nothing when we expected something that wasn't a Dark Manuscript, since the layout has changed + if ((book != null && !bookcase.getPossibleBooks().contains(book)) || + (book == null && !bookcase.getPossibleBooks().isEmpty() && bookcase.getPossibleBooks().stream().noneMatch(Book::isDarkManuscript))) { - // Check to see if our guess is wrong - if (!bookcase.getPossibleBooks().contains(book)) - { - reset(); - } + reset(); } }