mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-10 04:40:10 +07:00
Sectors with world processors get reset on gameover
This commit is contained in:
parent
8e1df180bc
commit
56f3dac3d2
@ -404,7 +404,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
ui.planet.hide();
|
ui.planet.hide();
|
||||||
SaveSlot slot = sector.save;
|
SaveSlot slot = sector.save;
|
||||||
sector.planet.setLastSector(sector);
|
sector.planet.setLastSector(sector);
|
||||||
if(slot != null && !clearSectors && (!sector.planet.clearSectorOnLose || sector.info.hasCore)){
|
if(slot != null && !clearSectors && (!(sector.planet.clearSectorOnLose || sector.info.hasWorldProcessor) || sector.info.hasCore)){
|
||||||
|
|
||||||
try{
|
try{
|
||||||
boolean hadNoCore = !sector.info.hasCore;
|
boolean hadNoCore = !sector.info.hasCore;
|
||||||
@ -417,7 +417,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
//if there is no base, simulate a new game and place the right loadout at the spawn position
|
//if there is no base, simulate a new game and place the right loadout at the spawn position
|
||||||
if(state.rules.defaultTeam.cores().isEmpty() || hadNoCore){
|
if(state.rules.defaultTeam.cores().isEmpty() || hadNoCore){
|
||||||
|
|
||||||
if(sector.planet.clearSectorOnLose){
|
if(sector.planet.clearSectorOnLose || sector.info.hasWorldProcessor){
|
||||||
playNewSector(origin, sector, reloader);
|
playNewSector(origin, sector, reloader);
|
||||||
}else{
|
}else{
|
||||||
//no spawn set -> delete the sector save
|
//no spawn set -> delete the sector save
|
||||||
|
@ -38,6 +38,8 @@ public class SectorInfo{
|
|||||||
public int storageCapacity = 0;
|
public int storageCapacity = 0;
|
||||||
/** Whether a core is available here. */
|
/** Whether a core is available here. */
|
||||||
public boolean hasCore = true;
|
public boolean hasCore = true;
|
||||||
|
/** Whether a world processor is on this map - implies that the map will get cleared. */
|
||||||
|
public boolean hasWorldProcessor;
|
||||||
/** Whether this sector was ever fully captured. */
|
/** Whether this sector was ever fully captured. */
|
||||||
public boolean wasCaptured = false;
|
public boolean wasCaptured = false;
|
||||||
/** Sector that was launched from. */
|
/** Sector that was launched from. */
|
||||||
@ -175,6 +177,7 @@ public class SectorInfo{
|
|||||||
spawnPosition = entity.pos();
|
spawnPosition = entity.pos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasWorldProcessor = state.teams.present.contains(t -> t.getBuildings(Blocks.worldProcessor).any());
|
||||||
waveSpacing = state.rules.waveSpacing;
|
waveSpacing = state.rules.waveSpacing;
|
||||||
wave = state.wave;
|
wave = state.wave;
|
||||||
winWave = state.rules.winWave;
|
winWave = state.rules.winWave;
|
||||||
|
Loading…
Reference in New Issue
Block a user