Merge pull request #10462 from Hydrox6/library-fix-fix

kourendlibrary: fix layout resetting unintentionally
This commit is contained in:
Adam
2019-12-17 13:16:15 -05:00
committed by GitHub

View File

@@ -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();
}
}