mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 11:10:50 +03:00
Update CommandAI.java (#12328)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user