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
@@ -473,6 +473,12 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
return controller instanceof AIController;
}
/** @return whether the unit *can* be commanded, even if its controller is not currently CommandAI. */
public boolean allowCommand(){
return controller instanceof CommandAI || (controller instanceof LogicAI && type.allowChangeCommands);
}
/** @return whether the unit has a CommandAI controller */
public boolean isCommandable(){
return controller instanceof CommandAI;
}