This commit is contained in:
Anuken
2018-07-28 10:06:28 -04:00
parent 0454c4c25a
commit 924b1c1a67
4 changed files with 30 additions and 27 deletions

View File

@@ -375,7 +375,7 @@ public class Control extends Module{
if(!state.mode.infiniteResources && Timers.get("timerCheckUnlock", 120)){
checkUnlockableBlocks();
//save if the db changed, but don't save unlocks
//save if the db changed, but don't save in debug
if(db.isDirty() && !debug){
db.save();
}

View File

@@ -15,6 +15,7 @@ import io.anuke.mindustry.world.Edges;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.util.Bits;
import io.anuke.ucore.util.GridMap;
import io.anuke.ucore.util.Log;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.*;
@@ -36,8 +37,19 @@ public class Sectors{
sector.saveID = control.getSaves().addSave("sector-" + sector.packedPosition()).index;
world.sectors().save();
}else{
control.getSaves().getByID(sector.saveID).load();
state.set(State.playing);
try{
sector.getSave().load();
state.set(State.playing);
}catch(Exception e){
Log.err(e);
sector.getSave().delete();
playSector(sector);
if(!headless){
threads.runGraphics(() -> ui.showError("$text.sector.corrupted"));
}
}
}
}