Disable naval units on ground / Mobile payload input

This commit is contained in:
Anuken
2020-08-17 16:15:51 -04:00
parent 9a48028508
commit 7ecf5aa26d
11 changed files with 83 additions and 32 deletions
+12 -3
View File
@@ -572,9 +572,18 @@ public class MobileInput extends InputHandler implements GestureListener{
}
//apply command on double tap
if(count == 2 && Mathf.within(worldx, worldy, player.unit().x, player.unit().y, player.unit().hitSize * 2f) &&
player.unit() instanceof Commanderc){
Call.unitCommand(player);
if(count == 2 && Mathf.within(worldx, worldy, player.unit().x, player.unit().y, player.unit().hitSize * 2f)){
if(player.unit() instanceof Commanderc){
Call.unitCommand(player);
}
if(player.unit() instanceof Payloadc){
if(((Payloadc)player.unit()).hasPayload()){
tryDropPayload();
}else{
tryPickupPayload();
}
}
}
}