v1.2.0: remains logic now writes an empty bones file instead of deleting
This commit is contained in:
parent
879917f601
commit
397d9af143
|
@ -130,7 +130,9 @@ public class Bones {
|
|||
Bundle bundle = FileUtils.bundleFromFile(BONES_FILE);
|
||||
|
||||
depth = bundle.getInt( LEVEL );
|
||||
if (depth > 0) {
|
||||
item = (Item) bundle.get(ITEM);
|
||||
}
|
||||
|
||||
return get();
|
||||
|
||||
|
@ -141,7 +143,13 @@ public class Bones {
|
|||
} else {
|
||||
//heroes who are challenged cannot find bones
|
||||
if (depth == Dungeon.depth && Dungeon.challenges == 0) {
|
||||
FileUtils.deleteFile( BONES_FILE );
|
||||
Bundle emptyBones = new Bundle();
|
||||
emptyBones.put(LEVEL, 0);
|
||||
try {
|
||||
FileUtils.bundleToFile( BONES_FILE, emptyBones );
|
||||
} catch (IOException e) {
|
||||
ShatteredPixelDungeon.reportException(e);
|
||||
}
|
||||
depth = 0;
|
||||
|
||||
if (item == null) return null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user