Misc bugfixes

This commit is contained in:
Anuken
2022-06-13 23:23:45 -04:00
parent f5b38ccbba
commit ce27388fad
2 changed files with 12 additions and 10 deletions

View File

@@ -350,7 +350,7 @@ public class LExecutor{
/** Checks is a unit is valid for logic AI control, and returns the controller. */
@Nullable
public static LogicAI checkLogicAI(LExecutor exec, Object unitObj){
if(unitObj instanceof Unit unit && unit.isValid() && exec.obj(varUnit) == unit && unit.team == exec.team && !unit.isPlayer() && !(unit.isCommandable() && unit.command().hasCommand())){
if(unitObj instanceof Unit unit && unit.isValid() && exec.obj(varUnit) == unit && (unit.team == exec.team || exec.privileged) && !unit.isPlayer() && !(unit.isCommandable() && unit.command().hasCommand())){
if(unit.controller() instanceof LogicAI la){
la.controller = exec.building(varThis);
return la;