Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-09-20 09:19:16 -04:00
11 changed files with 32 additions and 14 deletions

View File

@@ -55,6 +55,16 @@ public class Saves{
}
}
//clear saves from build <130 that had the new naval sectors.
saves.removeAll(s -> {
if(s.getSector() != null && (s.getSector().id == 108 || s.getSector().id == 216) && s.meta.build <= 130 && s.meta.build > 0){
s.getSector().clearInfo();
s.file.delete();
return true;
}
return false;
});
lastSectorSave = saves.find(s -> s.isSector() && s.getName().equals(Core.settings.getString("last-sector-save", "<none>")));
//automatically assign sector save slots
@@ -289,7 +299,7 @@ public class Saves{
return meta.mods;
}
public Sector getSector(){
public @Nullable Sector getSector(){
return meta == null || meta.rules == null ? null : meta.rules.sector;
}