Save on exit

This commit is contained in:
Anuken
2020-05-14 15:18:04 -04:00
parent d54d8a25af
commit 12f4d5a9a4
2 changed files with 11 additions and 1 deletions

View File

@@ -353,6 +353,16 @@ public class Control implements ApplicationListener, Loadable{
@Override
public void dispose(){
//try to save when exiting
if(saves != null && saves.getCurrent() != null && saves.getCurrent().isAutosave() && !net.client()){
try{
control.saves.getCurrent().save();
Log.info("Saved on exit.");
}catch(Throwable e){
e.printStackTrace();
}
}
content.dispose();
net.dispose();
Musics.dispose();