Test fixes

This commit is contained in:
Anuken
2022-10-01 20:55:30 -04:00
parent 9d4ca4e8ae
commit 2822764698
3 changed files with 13 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ public class FileMapGenerator implements WorldGenerator{
} }
if(tile.isCenter() && tile.block() instanceof CoreBlock && tile.team() == state.rules.defaultTeam && !anyCores){ if(tile.isCenter() && tile.block() instanceof CoreBlock && tile.team() == state.rules.defaultTeam && !anyCores){
if(sector != null && sector.allowLaunchLoadout()){ if(state.rules.sector != null && state.rules.sector.allowLaunchLoadout()){
Schematics.placeLaunchLoadout(tile.x, tile.y); Schematics.placeLaunchLoadout(tile.x, tile.y);
} }
anyCores = true; anyCores = true;

View File

@@ -44,6 +44,17 @@ public class LaunchLoadoutDialog extends BaseDialog{
ItemSeq sitems = sector.items(); ItemSeq sitems = sector.items();
//hide nonsensical items
ItemSeq launch = universe.getLaunchResources();
if(sector.planet.allowLaunchLoadout){
for(var item : content.items()){
if(sector.planet.hiddenItems.contains(item)){
launch.set(item, 0);
}
}
universe.updateLaunchResources(launch);
}
//updates sum requirements //updates sum requirements
Runnable update = () -> { Runnable update = () -> {
int cap = lastCapacity = (int)(sector.planet.launchCapacityMultiplier * selected.findCore().itemCapacity); int cap = lastCapacity = (int)(sector.planet.launchCapacityMultiplier * selected.findCore().itemCapacity);

View File

@@ -873,6 +873,7 @@ public class ApplicationTests{
Time.setDeltaProvider(() -> 1f); Time.setDeltaProvider(() -> 1f);
logic.reset(); logic.reset();
state.rules.sector = zone.sector;
try{ try{
world.loadGenerator(zone.generator.map.width, zone.generator.map.height, zone.generator::generate); world.loadGenerator(zone.generator.map.width, zone.generator.map.height, zone.generator::generate);
}catch(SaveException e){ }catch(SaveException e){