From 22a999203fc9d5be3c45e308d174373108bd0def Mon Sep 17 00:00:00 2001 From: zealerker22 <97942218+zealerker22@users.noreply.github.com> Date: Thu, 4 Jul 2024 22:31:36 -0400 Subject: [PATCH] fixed puzzle resets not updating failed puzzle amount --- .../skytilsmod/features/impl/dungeons/ScoreCalculation.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt index 05c26e09e..f796d70a8 100644 --- a/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt +++ b/src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/ScoreCalculation.kt @@ -25,6 +25,7 @@ import gg.skytils.skytilsmod.core.GuiManager import gg.skytils.skytilsmod.core.structure.GuiElement import gg.skytils.skytilsmod.core.tickTimer import gg.skytils.skytilsmod.events.impl.MainReceivePacketEvent +import gg.skytils.skytilsmod.events.impl.skyblock.DungeonEvent import gg.skytils.skytilsmod.features.impl.dungeons.DungeonFeatures.dungeonFloorNumber import gg.skytils.skytilsmod.features.impl.handlers.MayorInfo import gg.skytils.skytilsmod.listeners.DungeonListener @@ -453,6 +454,12 @@ object ScoreCalculation { } } + @SubscribeEvent + fun onPuzzleReset(event: DungeonEvent.PuzzleEvent.Reset) { + missingPuzzles.set(missingPuzzles.get() + 1) + failedPuzzles.set((failedPuzzles.get() - 1).coerceAtLeast(0)) + } + @SubscribeEvent(priority = EventPriority.LOWEST) fun canYouPleaseStopCryingThanks(event: ClientChatReceivedEvent) { if (!Utils.inDungeons || event.type != 0.toByte()) return