From e2177d7392e42cfec76b893edde561e7d54c6f85 Mon Sep 17 00:00:00 2001 From: Malkierian Date: Sat, 13 May 2023 11:45:20 -0700 Subject: [PATCH] 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). --- soh/soh/SaveManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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");