mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-07-04 05:21:20 -04:00
Merge branch 'develop-blair' of github.com:Malkierian/Shipwright into develop
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user