Made Corvus/Vela no longer stop to shoot with command AI

This commit is contained in:
Anuken
2022-09-20 22:51:38 -04:00
parent 9b7ac713ee
commit 4c8c0efd0c
2 changed files with 17 additions and 1 deletions

View File

@@ -68,7 +68,18 @@ public class CommandAI extends AIController{
}
updateVisuals();
updateTargeting();
//only autotarget if the unit supports it
if(targetPos == null || unit.type.autoFindTarget){
updateTargeting();
}else if(attackTarget == null){
//if the unit does not have an attack target, is currently moving, and does not have autotargeting, stop attacking stuff
target = null;
for(var mount : unit.mounts){
if(mount.weapon.controllable){
mount.target = null;
}
}
}
if(attackTarget != null && invalid(attackTarget)){
attackTarget = null;