Closes Anuken/Mindustry-Suggestions/issues/4452

This commit is contained in:
Anuken 2023-06-07 09:52:50 -04:00
parent 4d301ebdbf
commit af76e889cf
2 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ public class Universe{
//queue random invasions
if(!sector.isAttacked() && sector.planet.allowSectorInvasion && sector.info.minutesCaptured > invasionGracePeriod && sector.info.hasSpawns){
int count = sector.near().count(Sector::hasEnemyBase);
int count = sector.near().count(s -> s.hasEnemyBase() && !s.hasBase());
//invasion chance depends on # of nearby bases
if(count > 0 && Mathf.chance(baseInvasionChance * (0.8f + (count - 1) * 0.3f))){

View File

@ -121,7 +121,7 @@ public class Sector{
return save != null && (info.waves || info.attack) && info.hasCore;
}
/** @return whether the player has a base here. */
/** @return whether the player has a base (active save with a core) here. */
public boolean hasBase(){
return save != null && info.hasCore && !(Vars.state.isGame() && Vars.state.rules.sector == this && state.gameOver);
}