v2.5.0: adjusted loading order for old games in progress data

This commit is contained in:
Evan Debenham
2024-08-07 14:16:45 -04:00
parent 2a14110f9b
commit 3b79b0c218
2 changed files with 8 additions and 12 deletions

View File

@@ -594,13 +594,8 @@ public class Dungeon {
return false;
}
// 1/4
// 3/4 * 1/3 = 3/12 = 1/4
// 3/4 * 2/3 * 1/2 = 6/24 = 1/4
// 1/4
private static final String INIT_VER = "init_ver";
private static final String VERSION = "version";
public static final String VERSION = "version";
private static final String SEED = "seed";
private static final String CUSTOM_SEED = "custom_seed";
private static final String DAILY = "daily";

View File

@@ -103,13 +103,14 @@ public class GamesInProgress {
try {
Bundle bundle = FileUtils.bundleFromFile(gameFile(slot));
info = new Info();
info.slot = slot;
Dungeon.preview(info, bundle);
//saves from before v1.4.3 are not supported
if (info.version < ShatteredPixelDungeon.v1_4_3) {
if (bundle.getInt( "version" ) < ShatteredPixelDungeon.v1_4_3) {
info = null;
} else {
info = new Info();
info.slot = slot;
Dungeon.preview(info, bundle);
}
} catch (IOException e) {