From ac7b96126d41f18325220e217e89e74460ba07f6 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 13 Nov 2023 19:02:05 +0100 Subject: Fixed highlighting some mobs in dungeon wrongly as area mini bosses. --- src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt | 6 +++++- .../skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt | 7 ++++--- src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt index c827a9f53..7a2243fbc 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt @@ -28,6 +28,7 @@ object SlayerAPI { var questStartTime = 0L var isInCorrectArea = false + var isInAnyArea = false var latestSlayerCategory = "" private var latestProgressChangeTime = 0L var latestWrongAreaWarning = 0L @@ -122,9 +123,12 @@ object SlayerAPI { if (event.isMod(5)) { isInCorrectArea = if (LorenzUtils.isStrandedProfile) { + isInAnyArea = true true } else { - getSlayerTypeForCurrentArea() == getActiveSlayer() + val slayerTypeForCurrentArea = getSlayerTypeForCurrentArea() + isInAnyArea = slayerTypeForCurrentArea != null + slayerTypeForCurrentArea == getActiveSlayer() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt index e63119a11..97d891020 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.combat.mobs import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.SlayerAPI import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent @@ -47,8 +48,8 @@ class AreaMiniBossFeatures { if (config.areaBossHighlight) { val color = bossType.color.toColor().withAlpha(bossType.colorOpacity) RenderLivingEntityHelper.setEntityColor(entity, color) - { config.areaBossHighlight } - RenderLivingEntityHelper.setNoHurtTime(entity) { config.areaBossHighlight } + { config.areaBossHighlight && SlayerAPI.isInAnyArea } + RenderLivingEntityHelper.setNoHurtTime(entity) { config.areaBossHighlight && SlayerAPI.isInAnyArea } } // TODO add sound @@ -118,4 +119,4 @@ class AreaMiniBossFeatures { ), ; } -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index a5f0392b9..763b4602e 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -322,6 +322,7 @@ class SkyHanniDebugsAndTests { builder.append("Doing slayer!\n") builder.append(" activeSlayer: ${SlayerAPI.getActiveSlayer()}\n") builder.append(" isInCorrectArea: ${SlayerAPI.isInCorrectArea}\n") + builder.append(" isInAnyArea: ${SlayerAPI.isInAnyArea}\n") } } -- cgit