summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2023-05-13 11:45:20 -0700
committerMalkierian <malkierian@gmail.com>2023-05-13 11:45:20 -0700
commite2177d7392e42cfec76b893edde561e7d54c6f85 (patch)
tree1bae789b830fe700e0bca3efd31a4222b8450129
parent550c10b1c37d9204154445dd4f1d10c22dee45ed (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.cpp4
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 = &sectionBlock["data"];
sectionHandler.second.second(saveContext, "all");