mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-26 15:54:26 -04:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c588d48672 | |||
| 35ad68578e |
+1
-1
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user