Removed saves that weren't support to be there

This commit is contained in:
Anuken 2017-12-29 16:51:49 -05:00
parent af1cda0c91
commit b7c8ff4d5b
6 changed files with 25 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,6 +5,9 @@ import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Timer;
import com.badlogic.gdx.utils.Timer.Task;
import com.badlogic.gdx.utils.async.AsyncExecutor;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import com.badlogic.gdx.utils.reflect.Field;
import com.badlogic.gdx.utils.reflect.ReflectionException;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.core.GameState;
import io.anuke.mindustry.core.GameState.State;
@ -33,8 +36,30 @@ public class Saves {
Timer.schedule(new Task() {
Field field;
int lastInterval;
{
try{
field = ClassReflection.getDeclaredField(getClass(), "intervalMillis");
field.setAccessible(true);
}catch (ReflectionException e){
throw new RuntimeException(e);
}
}
@Override
public void run() {
if(Settings.getInt("saveinterval") != lastInterval){
try{
field.set(this, (long)(Settings.getInt("saveinterval")) / 60f * 1000);
}catch (ReflectionException e){
throw new RuntimeException(e);
}
lastInterval = Settings.getInt("saveinterval");
}
if(!GameState.is(State.menu) && !GameState.is(State.dead) && current != null && current.isAutosave()){
saving = true;