diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-02 22:31:36 +0100 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-02 22:31:36 +0100 |
| commit | 21462ab907847c53664ca7edb9b02cede85cb647 (patch) | |
| tree | 7b83894e99051b3bc74011255487baa3269bcfb6 | |
| parent | ad4363d523e1b9dfdbd118af521456e5765590f3 (diff) | |
| download | SkyHanni-21462ab907847c53664ca7edb9b02cede85cb647.tar.gz SkyHanni-21462ab907847c53664ca7edb9b02cede85cb647.tar.bz2 SkyHanni-21462ab907847c53664ca7edb9b02cede85cb647.zip | |
Hopefully fixed getMultiplier for the last time
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 344cbd715..1a7175282 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -98,7 +98,7 @@ object NEUItems { Utils.disableCustomDungColours = false } - fun getMultiplier(rawId: String, tryCount: Int = 0, parent: String? = null): Pair<String, Int> { + fun getMultiplier(rawId: String, tryCount: Int = 0): Pair<String, Int> { if (multiplierCache.contains(rawId)) { return multiplierCache[rawId]!! } @@ -121,13 +121,13 @@ object NEUItems { if (map.size != 1) continue val current = map.iterator().next().toPair() val id = current.first - return if (id != parent) { - val child = getMultiplier(id, tryCount + 1, rawId) + return if (current.second > 1) { + val child = getMultiplier(id, tryCount + 1) val result = Pair(child.first, child.second * current.second) multiplierCache[rawId] = result result } else { - Pair(parent, 1) + Pair(rawId, 1) } } |
