Fixed #10806 / Fixed crash

This commit is contained in:
Anuken
2025-05-14 12:06:35 -04:00
parent 8951a2698e
commit e1e5bd5b3f
5 changed files with 33 additions and 30 deletions

View File

@@ -1242,6 +1242,7 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
@Override
public void setTexture(String textureName){
this.textureName = textureName;
if(headless) return;
boolean firstUpdate = fetchedRegion == null;

View File

@@ -196,7 +196,7 @@ public class SectorInfo{
}
/** Prepare data for writing to a save. */
public void prepare(){
public void prepare(Sector sector){
//update core items
items.clear();
@@ -237,12 +237,10 @@ public class SectorInfo{
export.clear();
}
if(state.rules.sector != null){
state.rules.sector.saveInfo();
}
sector.saveInfo();
if(state.rules.sector != null && state.rules.sector.planet.allowWaveSimulation){
SectorDamage.writeParameters(this);
if(sector.planet.allowWaveSimulation){
SectorDamage.writeParameters(sector);
}
}

View File

@@ -226,7 +226,7 @@ public class Universe{
sector.info.wavesPassed = wavesPassed;
}
float damage = attacked ? SectorDamage.getDamage(sector.info) : 0f;
float damage = attacked ? SectorDamage.getDamage(sector) : 0f;
//damage never goes down until the player visits the sector, so use max
sector.info.damage = Math.max(sector.info.damage, damage);