mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-12 00:38:44 +07:00
Patrol tweaks
This commit is contained in:
@ -213,6 +213,11 @@ public class CommandAI extends AIController{
|
|||||||
boolean move = true;
|
boolean move = true;
|
||||||
vecOut.set(targetPos);
|
vecOut.set(targetPos);
|
||||||
|
|
||||||
|
//TODO: should the unit stop when it finds a target?
|
||||||
|
if(stance == UnitStance.patrol && target != null && unit.within(target, unit.type.range - 2f)){
|
||||||
|
move = false;
|
||||||
|
}
|
||||||
|
|
||||||
if(unit.isGrounded() && stance != UnitStance.ram){
|
if(unit.isGrounded() && stance != UnitStance.ram){
|
||||||
move = Vars.controlPath.getPathPosition(unit, pathId, targetPos, vecOut, noFound);
|
move = Vars.controlPath.getPathPosition(unit, pathId, targetPos, vecOut, noFound);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user