mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-22 12:38:05 +07:00
Fixed crash
This commit is contained in:
parent
ff308641e1
commit
de23ef5d35
@ -124,7 +124,7 @@ public class Control extends Module{
|
||||
|
||||
Events.on(WorldLoadGraphicsEvent.class, event -> {
|
||||
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;
|
||||
player.dropCarry(); //drop off unit
|
||||
}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){
|
||||
player.moveTarget = unit;
|
||||
consumed = true;
|
||||
Effects.effect(Fx.select, unit.getX(), unit.getY());
|
||||
}
|
||||
if(unit != null){
|
||||
player.moveTarget = unit;
|
||||
Effects.effect(Fx.select, unit.getX(), unit.getY());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user