diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 13:20:44 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 13:20:44 +0100 |
commit | bb8c07cdaa0264120e0f934d99370a7321842ee6 (patch) | |
tree | 1c5dbd58a70fe20cd0a87bcbc88c4356c6aa723e /src/main/java | |
parent | 8dd26f8883de2cc5997d891f7067360ff7ac5db8 (diff) | |
download | skyhanni-bb8c07cdaa0264120e0f934d99370a7321842ee6.tar.gz skyhanni-bb8c07cdaa0264120e0f934d99370a7321842ee6.tar.bz2 skyhanni-bb8c07cdaa0264120e0f934d99370a7321842ee6.zip |
fixed more error messages with The Great Spook data getting stored in the Reputation Helper quest config by accident.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt index 41ac1a9c7..541d0510c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt @@ -157,11 +157,9 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { fun loadConfig(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { if (dailyQuestHelper.greatSpook) return - for (text in storage.quests.toList()) { - if (text.contains("The Great Spook")) { - dailyQuestHelper.greatSpook = true - return - } + if (storage.quests.toList().any { hasGreatSpookLine(it) }) { + dailyQuestHelper.greatSpook = true + return } for (text in storage.quests.toList()) { val split = text.split(":") @@ -182,6 +180,15 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { } } + private fun hasGreatSpookLine(text: String) = when { + text.contains("The Great Spook") -> true + text.contains(" Days") -> true + text.contains("Fear: §r") -> true + text.contains("Primal Fears") -> true + + else -> false + } + private fun addQuest(element: Quest) { dailyQuestHelper.quests.add(element) if (dailyQuestHelper.quests.size > 5) { |