aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-14 22:22:51 +0200
committerGitHub <noreply@github.com>2024-04-14 22:22:51 +0200
commita1e6aeeeeb240cea8919c2b40c9a4b419911928a (patch)
treed247497fb515bd64e54bd45c0a957760f3fc2151 /src/main/java/at/hannibal2/skyhanni/config
parent3c09b16b7f6a53c3d429c7060c7a851e3e122159 (diff)
downloadskyhanni-a1e6aeeeeb240cea8919c2b40c9a4b419911928a.tar.gz
skyhanni-a1e6aeeeeb240cea8919c2b40c9a4b419911928a.tar.bz2
skyhanni-a1e6aeeeeb240cea8919c2b40c9a4b419911928a.zip
Fix self reference occuring when performing an internalizing config move (#1447)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/config')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt
index 51bf33dbb..817be7867 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.events.LorenzEvent
import at.hannibal2.skyhanni.features.misc.limbo.LimboTimeTracker
import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils.asIntOrNull
+import at.hannibal2.skyhanni.utils.shDeepCopy
import com.google.gson.JsonElement
import com.google.gson.JsonObject
import com.google.gson.JsonPrimitive
@@ -11,7 +12,7 @@ import com.google.gson.JsonPrimitive
object ConfigUpdaterMigrator {
val logger = LorenzLogger("ConfigMigration")
- const val CONFIG_VERSION = 37
+ const val CONFIG_VERSION = 38
fun JsonElement.at(chain: List<String>, init: Boolean): JsonElement? {
if (chain.isEmpty()) return this
if (this !is JsonObject) return null
@@ -83,7 +84,7 @@ object ConfigUpdaterMigrator {
}
movesPerformed++
if (np == listOf("#player", "personalBest")) LimboTimeTracker.workaroundMigration(oldElem.asInt)
- newParentElement.add(np.last(), transform(oldElem))
+ newParentElement.add(np.last(), transform(oldElem.shDeepCopy()))
logger.log("Moved element from $oldPath to $newPath")
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java
index dd5ddb41b..2393df0f7 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java
@@ -36,7 +36,7 @@ public class MiningConfig {
// TODO rename to fossilExcavator
@Expose
@Category(name = "Fossil Excavator", desc = "Settings for the Fossil Excavator Features")
- public FossilExcavatorConfig fossilExcavator2 = new FossilExcavatorConfig();
+ public FossilExcavatorConfig fossilExcavator = new FossilExcavatorConfig();
@Expose
@ConfigOption(name = "Notifications", desc = "")