From bb8c07cdaa0264120e0f934d99370a7321842ee6 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:20:44 +0100 Subject: fixed more error messages with The Great Spook data getting stored in the Reputation Helper quest config by accident. --- .../nether/reputationhelper/dailyquest/QuestLoader.kt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2') 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) { -- cgit