Merge branch 'develop-blair' of github.com:Malkierian/Shipwright into develop

This commit is contained in:
Malkierian
2025-06-12 17:21:23 -07:00
49 changed files with 900 additions and 763 deletions
+14 -4
View File
@@ -365,10 +365,20 @@ std::unordered_map<s16, s16> getItemIdToItemId = {
bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
if (strcmp(spoilerFileName, "") != 0) {
std::ifstream spoilerFileStream(SohUtils::Sanitize(spoilerFileName));
if (!spoilerFileStream) {
return false;
} else {
return true;
if (spoilerFileStream) {
nlohmann::json contents;
spoilerFileStream >> contents;
spoilerFileStream.close();
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 a version that doesn't match the currently running version.\n" +
"Loading for this file has been cancelled.");
}
}
}