mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 06:22:17 -08:00
Formation cleanup
This commit is contained in:
parent
01bd8d5148
commit
8dd4e9feb0
13 changed files with 82 additions and 8 deletions
|
|
@ -266,7 +266,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
if(commander.isCommanding()){
|
||||
commander.clearCommand();
|
||||
}else{
|
||||
SquareFormation pattern = new SquareFormation();
|
||||
FormationPattern pattern = new SquareFormation();
|
||||
Formation formation = new Formation(new Vec3(player.x, player.y, player.unit().rotation), pattern);
|
||||
formation.slotAssignmentStrategy = new DistanceAssignmentStrategy(pattern);
|
||||
|
||||
|
|
@ -282,8 +282,6 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||
units.sort(u -> u.dst2(player.unit()));
|
||||
units.truncate(player.unit().type().commandLimit);
|
||||
|
||||
if(units.any()) pattern.spacing = units.max(u -> u.hitSize).hitSize * 2f;
|
||||
|
||||
commander.command(formation, units);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue