Allow controlling/selecting units with LogicAI
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user