Fixed crash
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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{
|
||||||
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);
|
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);
|
||||||
|
|
||||||
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());
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user