Patrol tweaks

This commit is contained in:
Anuken 2023-09-23 17:09:50 -04:00
parent f63837fa4b
commit cafec1386c

View File

@ -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);