Allow controlling/selecting units with LogicAI

This commit is contained in:
Anuken
2025-04-21 14:23:01 -04:00
parent f1f610079d
commit 847ec1813e
6 changed files with 100 additions and 76 deletions

View File

@@ -288,14 +288,14 @@ public class DesktopInput extends InputHandler{
}
//validate commanding units
selectedUnits.removeAll(u -> !u.isCommandable() || !u.isValid() || u.team != player.team());
selectedUnits.removeAll(u -> !u.allowCommand() || !u.isValid() || u.team != player.team());
if(commandMode && !scene.hasField() && !scene.hasDialog()){
if(input.keyTap(Binding.select_all_units)){
selectedUnits.clear();
commandBuildings.clear();
for(var unit : player.team().data().units){
if(unit.isCommandable()){
if(unit.allowCommand()){
selectedUnits.add(unit);
}
}