mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 17:57:56 +07:00
Fixed not being able to move units on conveyors
This commit is contained in:
@ -562,18 +562,25 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
//add to selection queue if it's a valid BREAK position
|
//add to selection queue if it's a valid BREAK position
|
||||||
cursor = cursor.target();
|
cursor = cursor.target();
|
||||||
selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy()));
|
selection.add(new PlaceRequest(cursor.worldx(), cursor.worldy()));
|
||||||
}else if(!tileTapped(cursor.target()) && !canTapPlayer(worldx, worldy) && !tryBeginMine(cursor)){
|
}else if(!canTapPlayer(worldx, worldy)){
|
||||||
|
boolean consumed = false;
|
||||||
//else, try and carry units
|
//else, try and carry units
|
||||||
if(player.getCarry() != null){
|
if(player.getCarry() != null){
|
||||||
|
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);
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!consumed && !tileTapped(cursor.target())){
|
||||||
|
tryBeginMine(cursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user