summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--soh/soh/SaveManager.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp
index 2e2f05f72..bdb2800e3 100644
--- a/soh/soh/SaveManager.cpp
+++ b/soh/soh/SaveManager.cpp
@@ -1121,25 +1121,24 @@ void SaveManager::LoadFile(int fileNum) {
switch (saveBlock["version"].get<int>()) {
case 1:
for (auto& block : saveBlock["sections"].items()) {
+ bool oldVanilla =
+ block.value()["data"].empty() || block.value()["data"].contains("aat0") ||
+ block.value()["data"]["entrances"].empty() ||
+ SohUtils::IsStringEmpty(saveBlock["sections"]["sohStats"]["data"]["buildVersion"]);
std::string sectionName = block.key();
if (sectionName == "randomizer") {
- if (block.value()["data"].empty()) {
- deleteRando = true;
- continue;
- }
bool hasStats = saveBlock["sections"].contains("sohStats");
- if (block.value()["data"].contains("aat0") || !hasStats) { // Rachael rando data
+ if (oldVanilla || !hasStats) { // Vanilla "rando" data
SohGui::RegisterPopup(
"Loading old file",
"The file in slot " + std::to_string(fileNum + 1) +
- " appears to contain randomizer data, but is a very old format.\n" +
+ " appears to contain randomizer data, but is a very old format or is empty.\n" +
"The randomizer data has been removed, and this file will be treated as a vanilla "
- "file.\n" +
+ "file.\nIf this was a vanilla file, it still is, and you shouldn't see this "
+ "message again.\n" +
"If this was a randomizer file, the file will not work, and should be deleted.");
- input.close();
- saveMtx.unlock();
- SaveFile(fileNum);
- return;
+ deleteRando = true;
+ continue;
}
s16 major = saveBlock["sections"]["sohStats"]["data"]["buildVersionMajor"];
s16 minor = saveBlock["sections"]["sohStats"]["data"]["buildVersionMinor"];
@@ -1206,6 +1205,7 @@ void SaveManager::LoadFile(int fileNum) {
assert(false);
break;
}
+ input.close();
if (deleteRando) {
saveBlock["sections"].erase(saveBlock["sections"].find("randomizer"));
SaveFile(fileNum);