Do not command select logic controlled units by default

This commit is contained in:
Anuken
2025-05-01 10:27:47 -04:00
parent 5615182bc5
commit 1a07efd80b
5 changed files with 11 additions and 11 deletions
@@ -475,7 +475,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
/** @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 controller instanceof CommandAI || (controller instanceof LogicAI ai && (ai.controller == null || !ai.controller.block.privileged) && type.allowChangeCommands);
}
/** @return whether the unit has a CommandAI controller */
@@ -525,7 +525,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
}
public boolean playerControllable(){
return type.playerControllable;
return type.playerControllable && !(controller instanceof LogicAI ai && ai.controller != null && ai.controller.block.privileged);
}
public boolean targetable(Team targeter){