diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-14 22:22:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-14 22:22:51 +0200 |
commit | a1e6aeeeeb240cea8919c2b40c9a4b419911928a (patch) | |
tree | d247497fb515bd64e54bd45c0a957760f3fc2151 /src/main/java/at/hannibal2/skyhanni/config | |
parent | 3c09b16b7f6a53c3d429c7060c7a851e3e122159 (diff) | |
download | skyhanni-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.kt | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java | 2 |
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 = "") |