Better AI team check
This commit is contained in:
@@ -107,7 +107,7 @@ public class Team implements Comparable<Team>{
|
|||||||
|
|
||||||
/** @return whether this team is solely comprised of AI, with no players. */
|
/** @return whether this team is solely comprised of AI, with no players. */
|
||||||
public boolean isAI(){
|
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){
|
public boolean isEnemy(Team other){
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package mindustry.type.unit;
|
package mindustry.type.unit;
|
||||||
|
|
||||||
import mindustry.*;
|
|
||||||
import mindustry.ai.types.*;
|
import mindustry.ai.types.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
@@ -15,6 +14,6 @@ public class ErekirUnitType extends UnitType{
|
|||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
envDisabled = Env.space;
|
envDisabled = Env.space;
|
||||||
coreUnitDock = true;
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user