Compare commits

...

2 Commits

Author SHA1 Message Date
Malkierian c588d48672 Bump version to Blair Echo. (#5690) 2025-07-21 22:21:59 -07:00
Malkierian 35ad68578e Prevent empty randomizer blocks from triggering the rando version flow. (#5689)
Clear SpoilerLog CVar when unsupported spoiler log is discovered on load.
2025-07-21 22:19:04 -07:00
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ set(CMAKE_C_STANDARD 17 CACHE STRING "The C standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
project(Ship VERSION 9.0.3 LANGUAGES C CXX)
project(Ship VERSION 9.0.4 LANGUAGES C CXX)
include(CMake/soh-cvars.cmake)
include(CMake/lus-cvars.cmake)
@@ -406,6 +406,8 @@ bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
"The spoiler file located at\n" + std::string(spoilerFileName) +
"\nwas made by a version that doesn't match the currently running version.\n" +
"Loading for this file has been cancelled.");
CVarClear(CVAR_GENERAL("SpoilerLog"));
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
}
// Update cache
+10
View File
@@ -1111,6 +1111,7 @@ void SaveManager::LoadFile(int fileNum) {
std::ifstream input(fileName);
try {
bool deleteRando = false;
saveBlock = nlohmann::json::object();
input >> saveBlock;
if (!saveBlock.contains("version")) {
@@ -1122,6 +1123,10 @@ void SaveManager::LoadFile(int fileNum) {
for (auto& block : saveBlock["sections"].items()) {
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
SohGui::RegisterPopup(
@@ -1201,6 +1206,11 @@ void SaveManager::LoadFile(int fileNum) {
assert(false);
break;
}
if (deleteRando) {
saveBlock["sections"].erase(saveBlock["sections"].find("randomizer"));
SaveFile(fileNum);
deleteRando = false;
}
InitMeta(fileNum);
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnLoadFile>(fileNum);
} catch (const std::exception& e) {