Skip to content

Commit

Permalink
Bug Fix: Collapsed stockpile groups would have duplicates after update
Browse files Browse the repository at this point in the history
Merge Master
  • Loading branch information
GoldenGnu committed May 3, 2024
2 parents 554f8e2 + 4ff6b7e commit b3ee0b1
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ public void updateData(EventList<StockpileItem> eventList) {
//Update Stockpiles (StockpileItem)
for (Stockpile stockpile : StockpileTab.getShownStockpiles(profileManager)) {
stockpile.updateDynamicValues();
stockpileItems.addAll(stockpile.getItems());
updateStockpile(stockpile);
String group = Settings.get().getStockpileGroupSettings().getGroup(stockpile);
if (Settings.get().getStockpileGroupSettings().isGroupExpanded(group)) { //Stockpile group expanded or not in group
stockpileItems.addAll(stockpile.getItems());
} else {
stockpileItems.add(stockpile.getIgnoreItem());
}
}
//Update Subpiles (SubpileItem)
stockpileItems.addAll(getUpdatedSubpiles());
Expand Down Expand Up @@ -490,7 +495,10 @@ private void updateSubpile(List<StockpileItem> updated, List<StockpileItem> remo
}
updated.removeAll(subpileItems);
if (profileManager.getStockpileIDs().isShown(parent.getStockpileID())) {
updated.addAll(parent.getSubpileItems());
String group = Settings.get().getStockpileGroupSettings().getGroup(parent);
if (Settings.get().getStockpileGroupSettings().isGroupExpanded(group)) { //Stockpile group expanded or not in group
updated.addAll(parent.getSubpileItems());
}
}
}

Expand Down

0 comments on commit b3ee0b1

Please sign in to comment.