File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -406,6 +406,8 @@ bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
406406 " The spoiler file located at\n " + std::string (spoilerFileName) +
407407 " \n was made by a version that doesn't match the currently running version.\n " +
408408 " Loading for this file has been cancelled." );
409+ CVarClear (CVAR_GENERAL (" SpoilerLog" ));
410+ Ship::Context::GetInstance ()->GetWindow ()->GetGui ()->SaveConsoleVariablesNextFrame ();
409411 }
410412
411413 // Update cache
Original file line number Diff line number Diff line change @@ -1111,6 +1111,7 @@ void SaveManager::LoadFile(int fileNum) {
11111111 std::ifstream input (fileName);
11121112
11131113 try {
1114+ bool deleteRando = false ;
11141115 saveBlock = nlohmann::json::object ();
11151116 input >> saveBlock;
11161117 if (!saveBlock.contains (" version" )) {
@@ -1122,6 +1123,10 @@ void SaveManager::LoadFile(int fileNum) {
11221123 for (auto & block : saveBlock[" sections" ].items ()) {
11231124 std::string sectionName = block.key ();
11241125 if (sectionName == " randomizer" ) {
1126+ if (block.value ()[" data" ].empty ()) {
1127+ deleteRando = true ;
1128+ continue ;
1129+ }
11251130 bool hasStats = saveBlock[" sections" ].contains (" sohStats" );
11261131 if (block.value ()[" data" ].contains (" aat0" ) || !hasStats) { // Rachael rando data
11271132 SohGui::RegisterPopup (
@@ -1201,6 +1206,11 @@ void SaveManager::LoadFile(int fileNum) {
12011206 assert (false );
12021207 break ;
12031208 }
1209+ if (deleteRando) {
1210+ saveBlock[" sections" ].erase (saveBlock[" sections" ].find (" randomizer" ));
1211+ SaveFile (fileNum);
1212+ deleteRando = false ;
1213+ }
12041214 InitMeta (fileNum);
12051215 GameInteractor::Instance->ExecuteHooks <GameInteractor::OnLoadFile>(fileNum);
12061216 } catch (const std::exception& e) {
You can’t perform that action at this time.
0 commit comments