Fixed crash

This commit is contained in:
Anuken
2018-11-02 19:46:56 -04:00
parent ff308641e1
commit de23ef5d35
2 changed files with 8 additions and 7 deletions

View File

@@ -124,7 +124,7 @@ public class Control extends Module{
Events.on(WorldLoadGraphicsEvent.class, event -> { Events.on(WorldLoadGraphicsEvent.class, event -> {
if(mobile){ if(mobile){
Core.camera.position.set(players[0].x, players[0].y, 0); Gdx.app.postRunnable(() -> Core.camera.position.set(players[0].x, players[0].y, 0));
} }
}); });

View File

@@ -574,13 +574,14 @@ public class MobileInput extends InputHandler implements GestureListener{
consumed = true; consumed = true;
player.dropCarry(); //drop off unit player.dropCarry(); //drop off unit
}else{ }else{
threads.run(() -> {
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight); Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
if(unit != null){ if(unit != null){
player.moveTarget = unit; player.moveTarget = unit;
consumed = true;
Effects.effect(Fx.select, unit.getX(), unit.getY()); Effects.effect(Fx.select, unit.getX(), unit.getY());
} }
});
} }
} }