Made saves load backup files if original save gets corrupted
This commit is contained in:
@@ -130,7 +130,15 @@ public class SaveIO{
|
||||
}
|
||||
|
||||
public static void load(FileHandle file){
|
||||
load(file.read());
|
||||
try {
|
||||
load(file.read());
|
||||
}catch (RuntimeException e){
|
||||
e.printStackTrace();
|
||||
FileHandle backup = file.sibling(file.name() + "-backup." + file.extension());
|
||||
if(backup.exists()){
|
||||
load(backup.read());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void load(InputStream is){
|
||||
|
||||
Reference in New Issue
Block a user