diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-22 13:32:03 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-22 13:32:03 +0100 |
commit | 12b6f4f5a9d962dc178e1805a5900cb32e50ae34 (patch) | |
tree | 08e2fbea4a906c4572a6680169cf97c0a0631d6e /src/main/java/at/hannibal2 | |
parent | a66f85649faacb89d2b3afaa7b19bd508779af0d (diff) | |
download | skyhanni-12b6f4f5a9d962dc178e1805a5900cb32e50ae34.tar.gz skyhanni-12b6f4f5a9d962dc178e1805a5900cb32e50ae34.tar.bz2 skyhanni-12b6f4f5a9d962dc178e1805a5900cb32e50ae34.zip |
using null instead of empty string
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt index f776eb155..1dcc92dab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt @@ -35,11 +35,12 @@ class DungeonCopilot { fun onChatMessage(event: LorenzChatEvent) { if (!isEnabled()) return - val blockReason = copilot(event.message) - if (blockReason != "") event.blockedReason = blockReason + copilot(event.message)?.let { + event.blockedReason = it + } } - private fun copilot(message: String): String { + private fun copilot(message: String): String? { countdownPattern.matchMatcher(message) { changeNextStep("Ready up") } @@ -77,7 +78,7 @@ class DungeonCopilot { changeNextStep("Enter Boss Room") return "dungeon_copilot" } - return "" + return null } private fun changeNextStep(step: String) { |