mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-10 07:47:25 +07:00
Made saves load backup files if original save gets corrupted
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#Autogenerated file. Do not modify.
|
||||
#Sun Apr 15 23:12:17 EDT 2018
|
||||
#Mon Apr 16 21:11:17 EDT 2018
|
||||
version=release
|
||||
androidBuildCode=517
|
||||
androidBuildCode=519
|
||||
name=Mindustry
|
||||
code=3.5
|
||||
build=custom build
|
||||
|
@ -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