Great cleanup
This commit is contained in:
@@ -77,7 +77,6 @@ public class Saves{
|
||||
}
|
||||
|
||||
public void update(){
|
||||
|
||||
if(current != null && state.isGame()
|
||||
&& !(state.isPaused() && Core.scene.hasDialog())){
|
||||
if(lastTimestamp != 0){
|
||||
@@ -93,8 +92,8 @@ public class Saves{
|
||||
|
||||
try{
|
||||
current.save();
|
||||
}catch(Throwable e){
|
||||
e.printStackTrace();
|
||||
}catch(Throwable t){
|
||||
Log.err(t);
|
||||
}
|
||||
|
||||
Time.runTask(3f, () -> saving = false);
|
||||
@@ -218,7 +217,7 @@ public class Saves{
|
||||
previewFile().writePNG(renderer.minimap.getPixmap());
|
||||
requestedPreview = false;
|
||||
}catch(Throwable t){
|
||||
t.printStackTrace();
|
||||
Log.err(t);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -133,10 +133,10 @@ public class Teams{
|
||||
private void count(Unit unit){
|
||||
unit.team.data().updateCount(unit.type, 1);
|
||||
|
||||
if(unit instanceof Payloadc){
|
||||
((Payloadc)unit).payloads().each(p -> {
|
||||
if(p instanceof UnitPayload){
|
||||
count(((UnitPayload)p).unit);
|
||||
if(unit instanceof Payloadc payloadc){
|
||||
payloadc.payloads().each(p -> {
|
||||
if(p instanceof UnitPayload payload){
|
||||
count(payload.unit);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user