Targetp support for allied targets

This commit is contained in:
Anuken
2021-01-09 10:31:44 -05:00
parent b762a5028b
commit 21fd20ea5b
8 changed files with 18 additions and 5 deletions

View File

@@ -123,7 +123,7 @@ public class AIController implements UnitController{
targets[i] = findTarget(mountX, mountY, weapon.bullet.range(), weapon.bullet.collidesAir, weapon.bullet.collidesGround);
}
if(Units.invalidateTarget(targets[i], unit.team, mountX, mountY, weapon.bullet.range())){
if(checkTarget(targets[i], mountX, mountY, weapon.bullet.range())){
targets[i] = null;
}
}
@@ -149,6 +149,10 @@ public class AIController implements UnitController{
}
}
protected boolean checkTarget(Teamc target, float x, float y, float range){
return Units.invalidateTarget(target, unit.team, x, y, range);
}
protected boolean shouldShoot(){
return true;
}