Update CommandAI.java (#12328)

This commit is contained in:
guiY
2026-07-09 12:17:35 -04:00
committed by GitHub
parent 4c2d9d791d
commit f9f9369082
+3 -1
View File
@@ -517,7 +517,9 @@ public class CommandAI extends AIController{
@Override
public void hit(Bullet bullet){
if(unit.team.isAI() && bullet.owner instanceof Teamc teamc && teamc.team() != unit.team && attackTarget == null &&
if(unit.team.isAI() &&
//excluding bullets
(!(bullet.owner instanceof Bullet) && bullet.owner instanceof Teamc teamc) && teamc.team() != unit.team && attackTarget == null &&
//can only counter-attack every few seconds to prevent rapidly changing targets
!(teamc instanceof Unit u && !u.checkTarget(unit.type.targetAir, unit.type.targetGround)) && timer.get(timerTarget4, 60f * 10f)){
commandTarget(teamc, true);