aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-27 22:02:29 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-27 22:02:29 +0200
commit921ee1faa468d69fb70d2698fb210fc3eb61170d (patch)
treef6dfc5dcc604bea76e62b9a015489b37edd37e1f
parent856e8b22200b64cfd4ae5523aa4dfd8b5a3b2bf4 (diff)
downloadskyhanni-921ee1faa468d69fb70d2698fb210fc3eb61170d.tar.gz
skyhanni-921ee1faa468d69fb70d2698fb210fc3eb61170d.tar.bz2
skyhanni-921ee1faa468d69fb70d2698fb210fc3eb61170d.zip
more debug information if trophy fish data failed to load correctly
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt9
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt
index 32d31595b..69e1a0efc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt
@@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.features.fishing
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzToolTipEvent
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
-import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NumberUtil
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt
index 629aaa02f..395fea310 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.features.fishing
+import at.hannibal2.skyhanni.test.command.CopyErrorCommand
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.StringUtils.splitLines
import com.google.gson.annotations.Expose
@@ -37,7 +38,13 @@ data class TrophyFishInfo(
)
}
- fun getFilletValue(rarity: TrophyRarity) = fillet.getOrDefault(rarity, -1)
+ fun getFilletValue(rarity: TrophyRarity): Int {
+ if (fillet == null) {
+ CopyErrorCommand.logError(Error("fillet is null for '$displayName'"), "Error trying to read trophy fish info")
+ return -1
+ }
+ return fillet.getOrDefault(rarity, -1)
+ }
private fun formatCount(counts: Map<TrophyRarity, Int>, rarity: TrophyRarity): String {
val count = counts.getOrDefault(rarity, 0)