kourendlibrary: Don't reset state when not finding Varlamore Envoy
The Varlamore Envoy is a quest item which, while having a known location in the library once a rotation is determined, cannot be found under certain circumstances. (when the Depths of Despair quest has not been started, has been collected while completing the quest, and after the quest is completed) Previously searching a bookcase which could contain this book and not finding it would cause a state reset. This commit keeps those null finds from resetting the known library state.
This commit is contained in:
@@ -122,8 +122,9 @@ class Library
|
||||
if (bookcase.isBookSet())
|
||||
{
|
||||
// Bookcase is set from a previous mark
|
||||
// Check for a mismatch, unless it is now null and had a dark manuscript
|
||||
if (book != bookcase.getBook() && !(book == null && bookcase.getBook().isDarkManuscript()))
|
||||
// Check for a mismatch, unless it is now null and had a dark manuscript or Varlamore Envoy
|
||||
if (book != bookcase.getBook()
|
||||
&& !(book == null && (bookcase.getBook().isDarkManuscript() || bookcase.getBook() == VARLAMORE_ENVOY)))
|
||||
{
|
||||
reset();
|
||||
}
|
||||
@@ -140,8 +141,11 @@ class Library
|
||||
|
||||
if (state == SolvedState.COMPLETE)
|
||||
{
|
||||
// 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().isEmpty() && bookcase.getPossibleBooks().stream().noneMatch(Book::isDarkManuscript))
|
||||
// Reset if we found nothing when we expected something that wasn't a Dark Manuscript or Varlamore Envoy
|
||||
// since the layout has changed
|
||||
if (book == null
|
||||
&& !bookcase.getPossibleBooks().isEmpty()
|
||||
&& bookcase.getPossibleBooks().stream().noneMatch(b -> b.isDarkManuscript() || b == VARLAMORE_ENVOY))
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user