diff --git a/soh/soh/config/ConfigUpdaters.cpp b/soh/soh/config/ConfigUpdaters.cpp index e43e98b76..6c18b6fd4 100644 --- a/soh/soh/config/ConfigUpdaters.cpp +++ b/soh/soh/config/ConfigUpdaters.cpp @@ -71,17 +71,17 @@ namespace SOH { void ConfigVersion3Updater::Update(Ship::Config* conf) { conf->EraseBlock("Controllers"); + if (conf->GetNestedJson().contains("CVars") && conf->GetNestedJson()["CVars"].contains("gInjectItemCounts")) { + CVarClear("gInjectItemCounts"); + CVarSetInteger("gEnhancements.InjectItemCounts.GoldSkulltula", 1); + CVarSetInteger("gEnhancements.InjectItemCounts.HeartContainer", 1); + CVarSetInteger("gEnhancements.InjectItemCounts.HeartPiece", 1); + } for (Migration migration : version3Migrations) { if (migration.action == MigrationAction::Rename) { CVarCopy(migration.from.c_str(), migration.to.value().c_str()); } CVarClear(migration.from.c_str()); } - if (conf->Contains("CVars.gEnhancements.InjectItemCounts")) { - CVarClear("gEnhancements.InjectItemCounts"); - CVarSetInteger("gEnhancements.InjectItemCounts.GoldSkulltula", 1); - CVarSetInteger("gEnhancements.InjectItemCounts.HeartContainer", 1); - CVarSetInteger("gEnhancements.InjectItemCounts.HeartPiece", 1); - } } }