Fixed Quad Repair AI

This commit is contained in:
Anuken
2022-07-31 00:30:37 -04:00
parent ce0a8de25b
commit 3d64047a91
3 changed files with 8 additions and 9 deletions

View File

@@ -115,7 +115,7 @@ public class BuilderAI extends AIController{
}else{
if(assistFollowing != null){
moveTo(assistFollowing, assistFollowing.type.hitSize * 1.5f + 60f);
moveTo(assistFollowing, assistFollowing.type.hitSize + unit.type.hitSize/2f + 60f);
}
//follow someone and help them build

View File

@@ -28,12 +28,14 @@ public class RepairAI extends AIController{
unit.controlWeapons(false);
}
if(target != null){
if(!target.within(unit, unit.type.range * 0.65f) && target instanceof Building b && b.team == unit.team){
if(target != null && target instanceof Building b && b.team == unit.team){
if(unit.type.circleTarget){
circleAttack(120f);
}else if(!target.within(unit, unit.type.range * 0.65f)){
moveTo(target, unit.type.range * 0.65f);
}
unit.lookAt(target);
unit.lookAt(target);
}
}
//not repairing