From 3a7630ff3d4e0f6ec65606e55d3566fffba2889d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 4 Jun 2023 23:24:31 +0200 Subject: Fixed concurrent exceptions in BingoNextStepHelper --- .../at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt index d5b1c5144..db50fb671 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.features.bingo.nextstep.* import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -34,7 +35,7 @@ class BingoNextStepHelper { companion object { private val finalSteps = mutableListOf() - private val currentSteps = mutableListOf() + private var currentSteps = listOf() var currentHelp = listOf() fun command() { @@ -43,7 +44,7 @@ class BingoNextStepHelper { private fun updateResult(print: Boolean = false) { if (print) println() - currentSteps.clear() + currentSteps = listOf() for (step in finalSteps) { printRequirements(step, print) if (print) println() @@ -81,7 +82,7 @@ class BingoNextStepHelper { if (!step.done && !parentDone) { if (requirementsToDo == 0) { if (!currentSteps.contains(step)) { - currentSteps.add(step) + currentSteps = currentSteps.editCopy { add(step) } } } } -- cgit