diff options
| author | Malkierian <malkierian@gmail.com> | 2023-05-13 11:45:20 -0700 |
|---|---|---|
| committer | Malkierian <malkierian@gmail.com> | 2023-05-13 11:45:20 -0700 |
| commit | e2177d7392e42cfec76b893edde561e7d54c6f85 (patch) | |
| tree | 1bae789b830fe700e0bca3efd31a4222b8450129 | |
| parent | 550c10b1c37d9204154445dd4f1d10c22dee45ed (diff) | |
Added sanity check to clearing `sectionBlock["data"]` to only be for randomizer and only when the save file is not randomizer (to clear the existing structure from the loaded spoiler log).
| -rw-r--r-- | soh/soh/SaveManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index b72ea2076..f9e488b05 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -723,7 +723,9 @@ void SaveManager::SaveFileThreaded(int fileNum, SaveContext* saveContext, const if (std::find(gameSaveRegistry.begin(), gameSaveRegistry.end(), sectionHandler.first) != gameSaveRegistry.end()) { nlohmann::json& sectionBlock = saveBlock["sections"][sectionHandler.first]; sectionBlock["version"] = sectionHandler.second.first; - sectionBlock["data"] = nlohmann::json::object(); + if (sectionHandler.first == "randomizer" && !gSaveContext.n64ddFlag) { + sectionBlock["data"] = nlohmann::json::object(); + } currentJsonContext = §ionBlock["data"]; sectionHandler.second.second(saveContext, "all"); |
