Fixed map rule loadouts not applying on Erekir

This commit is contained in:
Anuken
2022-10-03 16:05:17 -04:00
parent 975384d3b1
commit eb1192cdbe
2 changed files with 4 additions and 2 deletions

View File

@@ -215,11 +215,12 @@ public class Logic implements ApplicationListener{
Events.fire(new PlayEvent());
//add starting items
if(!state.isCampaign()){
if(!state.isCampaign() || !state.rules.sector.planet.allowLaunchLoadout || (state.rules.sector.preset != null && state.rules.sector.preset.addStartingItems)){
for(TeamData team : state.teams.getActive()){
if(team.hasCore()){
CoreBuild entity = team.core();
entity.items.clear();
for(ItemStack stack : state.rules.loadout){
//make sure to cap storage
entity.items.add(stack.item, Math.min(stack.amount, entity.storageCapacity - entity.items.get(stack.item)));

View File

@@ -82,7 +82,8 @@ public class FileMapGenerator implements WorldGenerator{
}
anyCores = true;
if(preset.addStartingItems){
if(preset.addStartingItems || !preset.planet.allowLaunchLoadout){
tile.build.items.clear();
tile.build.items.add(state.rules.loadout);
}
}