diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-04 23:24:31 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-04 23:24:31 +0200 |
commit | 3a7630ff3d4e0f6ec65606e55d3566fffba2889d (patch) | |
tree | 6b1ca76818616ac9428bd4b44f7933ae6a0180ba /src/main/java/at/hannibal2 | |
parent | 644291019d9033eba9358791b4f771258d4f1163 (diff) | |
download | skyhanni-3a7630ff3d4e0f6ec65606e55d3566fffba2889d.tar.gz skyhanni-3a7630ff3d4e0f6ec65606e55d3566fffba2889d.tar.bz2 skyhanni-3a7630ff3d4e0f6ec65606e55d3566fffba2889d.zip |
Fixed concurrent exceptions in BingoNextStepHelper
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt | 7 |
1 files changed, 4 insertions, 3 deletions
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<NextStep>() - private val currentSteps = mutableListOf<NextStep>() + private var currentSteps = listOf<NextStep>() var currentHelp = listOf<String>() 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) } } } } |