Better AI team check

This commit is contained in:
Anuken
2022-02-10 16:03:37 -05:00
parent bf71b32c82
commit fc8eac4048
2 changed files with 2 additions and 3 deletions

View File

@@ -107,7 +107,7 @@ public class Team implements Comparable<Team>{
/** @return whether this team is solely comprised of AI, with no players. */
public boolean isAI(){
return state.rules.waves && this == state.rules.waveTeam;
return (state.rules.waves || state.rules.attackMode) && this == state.rules.waveTeam;
}
public boolean isEnemy(Team other){

View File

@@ -1,6 +1,5 @@
package mindustry.type.unit;
import mindustry.*;
import mindustry.ai.types.*;
import mindustry.graphics.*;
import mindustry.type.*;
@@ -15,6 +14,6 @@ public class ErekirUnitType extends UnitType{
outlineColor = Pal.darkOutline;
envDisabled = Env.space;
coreUnitDock = true;
unitBasedDefaultController = u -> !playerControllable || u.team.isAI() || (Vars.state.rules.attackMode && u.team == Vars.state.rules.waveTeam) ? defaultController.get() : new CommandAI();
unitBasedDefaultController = u -> !playerControllable || u.team.isAI() ? defaultController.get() : new CommandAI();
}
}