Allow research even if sector was attacked after capture

This commit is contained in:
Anuken
2020-11-26 21:48:45 -05:00
parent 869c329fbf
commit e39eceee28
5 changed files with 8 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ public class Objectives{
@Override
public boolean complete(){
return preset.sector.save != null && !preset.sector.isAttacked() && preset.sector.hasBase();
return preset.sector.save != null && (!preset.sector.isAttacked() || preset.sector.info.wasCaptured) && preset.sector.hasBase();
}
@Override

View File

@@ -33,6 +33,8 @@ public class SectorInfo{
public int storageCapacity = 0;
/** Whether a core is available here. */
public boolean hasCore = true;
/** Whether this sector was ever fully captured. */
public boolean wasCaptured = false;
/** Sector that was launched from. */
public @Nullable Sector origin;
/** Launch destination. */

View File

@@ -180,6 +180,7 @@ public class Universe{
}else if(attacked && wavesPassed > 0 && sector.info.winWave > 1 && sector.info.wave + wavesPassed >= sector.info.winWave && !sector.hasEnemyBase()){
//autocapture the sector
sector.info.waves = false;
sector.info.wasCaptured = true;
//fire the event
Events.fire(new SectorCaptureEvent(sector));