Fixed #3300
This commit is contained in:
@@ -55,6 +55,12 @@ public class ItemSeq implements Iterable<ItemStack>, Serializable{
|
||||
return out;
|
||||
}
|
||||
|
||||
public void min(int number){
|
||||
for(Item item : Vars.content.items()){
|
||||
set(item, Math.min(get(item), number));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean has(Item item){
|
||||
return values[item.id] > 0;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,13 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
|
||||
//updates sum requirements
|
||||
Runnable update = () -> {
|
||||
int cap = selected.findCore().itemCapacity;
|
||||
|
||||
//cap resources based on core type
|
||||
ItemSeq resources = universe.getLaunchResources();
|
||||
resources.min(cap);
|
||||
universe.updateLaunchResources(resources);
|
||||
|
||||
total.clear();
|
||||
selected.requirements().each(total::add);
|
||||
universe.getLaunchResources().each(total::add);
|
||||
@@ -79,7 +86,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
||||
ItemSeq stacks = universe.getLaunchResources();
|
||||
Seq<ItemStack> out = stacks.toSeq();
|
||||
|
||||
loadout.show(core.itemCapacity, out, UnlockableContent::unlocked, out::clear, () -> {}, () -> {
|
||||
loadout.show(selected.findCore().itemCapacity, out, UnlockableContent::unlocked, out::clear, () -> {}, () -> {
|
||||
universe.updateLaunchResources(new ItemSeq(out));
|
||||
update.run();
|
||||
rebuildItems.run();
|
||||
|
||||
Reference in New Issue
Block a user