mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
prevent infinite loop in save migration (#396)
This commit is contained in:
@@ -56,7 +56,9 @@ const std::unordered_map<uint32_t, std::function<void(nlohmann::json&)>> migrati
|
||||
|
||||
void SaveManager_MigrateSave(nlohmann::json& j) {
|
||||
int version = j.value("version", 0);
|
||||
while (version != CURRENT_SAVE_VERSION) {
|
||||
|
||||
// BENTODO: what should we do if the version number is greater?
|
||||
while (version < CURRENT_SAVE_VERSION) {
|
||||
if (migrations.contains(version)) {
|
||||
auto migration = migrations.at(version);
|
||||
migration(j);
|
||||
@@ -241,4 +243,4 @@ extern "C" s32 SaveManager_SysFlashrom_ReadData(void* saveBuffer, u32 pageNum, u
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user