This commit is contained in:
Anuken
2022-05-07 14:09:47 -04:00
parent dfac73d81c
commit 0d61d98c70
5 changed files with 10 additions and 11 deletions

View File

@@ -991,7 +991,9 @@ public class MobileInput extends InputHandler implements GestureListener{
}else if(target == null){
player.shooting = false;
if(Core.settings.getBool("autotarget") && !(player.unit() instanceof BlockUnitUnit u && u.tile() instanceof ControlBlock c && !c.shouldAutoTarget())){
target = Units.closestTarget(unit.team, unit.x, unit.y, range, u -> u.checkTarget(type.targetAir, type.targetGround), u -> type.targetGround);
if(player.unit().type.canAttack){
target = Units.closestTarget(unit.team, unit.x, unit.y, range, u -> u.checkTarget(type.targetAir, type.targetGround), u -> type.targetGround);
}
if(allowHealing && target == null){
target = Geometry.findClosest(unit.x, unit.y, indexer.getDamaged(Team.sharded));