mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-10 15:57:37 +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.
|
#Autogenerated file. Do not modify.
|
||||||
#Sun Apr 15 23:12:17 EDT 2018
|
#Mon Apr 16 21:11:17 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=517
|
androidBuildCode=519
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.5
|
code=3.5
|
||||||
build=custom build
|
build=custom build
|
||||||
|
@ -130,7 +130,15 @@ public class SaveIO{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void load(FileHandle file){
|
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){
|
public static void load(InputStream is){
|
||||||
|
Reference in New Issue
Block a user