mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-18 06:12:20 -05:00
Properly check for pre-existing gInjectItemCounts before setting the new separate CVars. (#4692)
This commit is contained in:
parent
0f167d119b
commit
add5347126
@ -71,17 +71,17 @@ namespace SOH {
|
|||||||
|
|
||||||
void ConfigVersion3Updater::Update(Ship::Config* conf) {
|
void ConfigVersion3Updater::Update(Ship::Config* conf) {
|
||||||
conf->EraseBlock("Controllers");
|
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) {
|
for (Migration migration : version3Migrations) {
|
||||||
if (migration.action == MigrationAction::Rename) {
|
if (migration.action == MigrationAction::Rename) {
|
||||||
CVarCopy(migration.from.c_str(), migration.to.value().c_str());
|
CVarCopy(migration.from.c_str(), migration.to.value().c_str());
|
||||||
}
|
}
|
||||||
CVarClear(migration.from.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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user