Added more hints

This commit is contained in:
Anuken
2020-11-21 17:17:03 -05:00
parent b09dc47aad
commit e4266d22f5
11 changed files with 68 additions and 59 deletions

View File

@@ -29,9 +29,14 @@ abstract class CommanderComp implements Entityc, Posc{
transient float minFormationSpeed;
public void update(){
if(controlling.isEmpty()){
formation = null;
}
if(formation != null){
formation.anchor.set(x, y, 0);
formation.updateSlots();
controlling.removeAll(u -> u.dead || !(u.controller() instanceof FormationAI ai && ai.leader == self()));
}
}
@@ -64,6 +69,8 @@ abstract class CommanderComp implements Entityc, Posc{
}
});
if(units.isEmpty()) return;
//sort by hitbox size, then by distance
units.sort(Structs.comps(Structs.comparingFloat(u -> -u.hitSize), Structs.comparingFloat(u -> u.dst2(this))));
units.truncate(type.commandLimit);