From 336400e4b1b09c7b28ef2231166476026c07642d Mon Sep 17 00:00:00 2001 From: Malkierian Date: Tue, 3 Jun 2025 17:57:47 -0700 Subject: [PATCH] clang --- .../Enhancements/randomizer/randomizer.cpp | 12 ++++--- soh/soh/SaveManager.cpp | 33 +++++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index aa257b709..cc9c2b044 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -365,13 +365,15 @@ bool Randomizer::SpoilerFileExists(const char* spoilerFileName) { nlohmann::json contents; spoilerFileStream >> contents; spoilerFileStream.close(); - if (contents.contains("version") && strcmp(std::string(contents["version"]).c_str(), (char*)gBuildVersion) == 0) { + if (contents.contains("version") && + strcmp(std::string(contents["version"]).c_str(), (char*)gBuildVersion) == 0) { return true; } else { - SohGui::RegisterPopup("Old Spoiler Version", "The spoiler file located at\n" + - std::string(spoilerFileName) + - "\nwas made by an version that doesn't match the currently running version.\n" + - "Loading for this file has been cancelled."); + SohGui::RegisterPopup( + "Old Spoiler Version", + "The spoiler file located at\n" + std::string(spoilerFileName) + + "\nwas made by an version that doesn't match the currently running version.\n" + + "Loading for this file has been cancelled."); } } } diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index fe5d8b3cf..e023f9afe 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -1118,11 +1118,13 @@ void SaveManager::LoadFile(int fileNum) { if (sectionName == "randomizer") { bool hasStats = saveBlock["sections"].contains("sohStats"); if (block.value()["data"].contains("aat0") || !hasStats) { // Rachael 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" + - "The randomizer data has been removed, and this file will be treated as a vanilla file.\n" + - "If this was a randomizer file, the file will not work, and should be deleted."); + 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" + + "The randomizer data has been removed, and this file will be treated as a vanilla " + "file.\n" + + "If this was a randomizer file, the file will not work, and should be deleted."); input.close(); saveMtx.unlock(); SaveFile(fileNum); @@ -1132,12 +1134,14 @@ void SaveManager::LoadFile(int fileNum) { s16 minor = saveBlock["sections"]["sohStats"]["data"]["buildVersionMinor"]; s16 patch = saveBlock["sections"]["sohStats"]["data"]["buildVersionPatch"]; // block loading outdated rando save - if (!(major == gBuildVersionMajor && minor == gBuildVersionMinor && patch == gBuildVersionPatch)) { + if (!(major == gBuildVersionMajor && minor == gBuildVersionMinor && + patch == gBuildVersionPatch)) { input.close(); std::string newFileName = Ship::Context::GetPathRelativeToAppDirectory("Save") + - ("/file" + std::to_string(fileNum + 1) + "-" + std::to_string(GetUnixTimestamp()) + ".bak"); + ("/file" + std::to_string(fileNum + 1) + "-" + + std::to_string(GetUnixTimestamp()) + ".bak"); std::filesystem::path newFile(newFileName); - + #if defined(__SWITCH__) || defined(__WIIU__) copy_file(fileName.c_str(), newFile.c_str()); #else @@ -1145,12 +1149,13 @@ void SaveManager::LoadFile(int fileNum) { #endif std::filesystem::remove(fileName); - SohGui::RegisterPopup("Outdated Randomizer Save", "The SoH version in the file in slot " + - std::to_string(fileNum + 1) + - " does not match the currently running version.\n" + - "Non-matching rando saves are unsupported, and the file has been renamed to\n" + - " " + newFileName + "\n" + - "If this was not in error, the file should be deleted."); + SohGui::RegisterPopup( + "Outdated Randomizer Save", + "The SoH version in the file in slot " + std::to_string(fileNum + 1) + + " does not match the currently running version.\n" + + "Non-matching rando saves are unsupported, and the file has been renamed to\n" + + " " + newFileName + "\n" + + "If this was not in error, the file should be deleted."); saveMtx.unlock(); SaveFile(fileNum); return;