mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Make patrol stance pursue targets
This commit is contained in:
parent
4cf9d54c3d
commit
a7f38ac2a6
4 changed files with 19 additions and 6 deletions
|
|
@ -1096,10 +1096,16 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
|
||||
//draw command overlay UI
|
||||
for(Unit unit : selectedUnits){
|
||||
if(unit.isFlying() != flying) continue;
|
||||
|
||||
CommandAI ai = unit.command();
|
||||
Position lastPos = ai.attackTarget != null ? ai.attackTarget : ai.targetPos;
|
||||
|
||||
if(flying && ai.attackTarget != null && ai.currentCommand().drawTarget){
|
||||
Drawf.target(ai.attackTarget.getX(), ai.attackTarget.getY(), 6f, Pal.remove);
|
||||
}
|
||||
|
||||
if(unit.isFlying() != flying) continue;
|
||||
|
||||
//draw target line
|
||||
if(ai.targetPos != null && ai.currentCommand().drawTarget){
|
||||
Position lineDest = ai.attackTarget != null ? ai.attackTarget : ai.targetPos;
|
||||
|
|
@ -1135,9 +1141,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
//Lines.poly(unit.x, unit.y, sides, rad + 1.5f);
|
||||
Draw.reset();
|
||||
|
||||
if(ai.attackTarget != null && ai.currentCommand().drawTarget){
|
||||
Drawf.target(ai.attackTarget.getX(), ai.attackTarget.getY(), 6f, Pal.remove);
|
||||
}
|
||||
|
||||
|
||||
if(lastPos == null){
|
||||
lastPos = unit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue