Implemented desktop carrying

This commit is contained in:
Anuken
2018-06-19 16:02:25 -04:00
parent 3c3147d665
commit e79494b5cb
4 changed files with 26 additions and 9 deletions

View File

@@ -509,7 +509,7 @@ public class AndroidInput extends InputHandler implements GestureListener{
if(player.getCarry() != null){
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());
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.pickupTarget = unit;