mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-13 00:05:23 +07:00
Crash fixes
This commit is contained in:
parent
3435132e87
commit
4b824f7a4c
@ -373,7 +373,9 @@ public class Control implements ApplicationListener, Loadable{
|
||||
public void update(){
|
||||
saves.update();
|
||||
//update and load any requested assets
|
||||
assets.update();
|
||||
if(assets != null){
|
||||
assets.update();
|
||||
}
|
||||
|
||||
input.updateController();
|
||||
|
||||
|
@ -5,6 +5,7 @@ import io.anuke.arc.assets.loaders.*;
|
||||
import io.anuke.arc.assets.loaders.resolvers.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.files.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.mindustry.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
|
||||
@ -25,6 +26,21 @@ public class MapPreviewLoader extends TextureLoader{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Texture loadSync(AssetManager manager, String fileName, FileHandle file, TextureParameter parameter){
|
||||
try{
|
||||
return super.loadSync(manager, fileName, file, parameter);
|
||||
}catch(Throwable e){
|
||||
e.printStackTrace();
|
||||
try{
|
||||
return new Texture(file);
|
||||
}catch(Throwable e2){
|
||||
e2.printStackTrace();
|
||||
return new Texture("sprites/error.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, TextureParameter parameter){
|
||||
return Array.with(new AssetDescriptor<>("contentcreate", Content.class));
|
||||
|
Loading…
Reference in New Issue
Block a user