mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-28 07:22:21 -08:00
Unit stances for specific item mining
This commit is contained in:
parent
ca19d525c4
commit
847a201597
11 changed files with 113 additions and 26 deletions
|
|
@ -54,6 +54,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
/** Used for dropping items. */
|
||||
final static float playerSelectRange = mobile ? 17f : 11f;
|
||||
final static float unitSelectRadScl = 1f;
|
||||
final static Seq<UnitStance> stancesOut = new Seq<>();
|
||||
final static IntSeq removed = new IntSeq();
|
||||
final static IntSet intSet = new IntSet();
|
||||
/** Maximum line length. */
|
||||
|
|
@ -369,6 +370,13 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
ai.attackTarget = null;
|
||||
}
|
||||
unit.lastCommanded = player.coloredName();
|
||||
|
||||
//make sure its stance is valid
|
||||
stancesOut.clear();
|
||||
unit.type.getUnitStances(unit, stancesOut);
|
||||
if(stancesOut.size > 0 && !stancesOut.contains(ai.stance)){
|
||||
ai.stance = stancesOut.first();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue