Skip to content

Commit 39ecda3

Browse files
authored
fix(#459): Use correct amounts from other tabs in the legacy summary. (#466)
This appears to fix #459, but I can't really explain why `!flow.ContainsKey` is the correct test. It gets the correct values for unlinked products, requested products, and requested products with overproduction; tested with Moss from Moss Redesign.
2 parents 2d83c55 + 5eb8958 commit 39ecda3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Yafc.Model/Model/ProductionSummary.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,8 @@ public void RefreshFlow() {
133133
}
134134

135135
foreach (var link in subTable.allLinks) {
136-
if (link.amount != 0) {
137-
_ = flow.TryGetValue(link.goods, out float prevValue);
138-
flow[link.goods] = prevValue + (link.amount * multiplier);
136+
if (link.amount != 0 && !flow.ContainsKey(link.goods)) {
137+
flow[link.goods] = link.amount * multiplier;
139138
}
140139
}
141140
}

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Date:
2222
- When loading duplicate research productivity effects, obey both of them, instead of failing.
2323
- Fixed a crash when item.weight == 0, related to ultracube.
2424
- If the requested mod version isn't found, use the latest, like Factorio.
25+
- Fix amounts loaded from other pages in the legacy summary page.
2526
----------------------------------------------------------------------------------------------------------------------
2627
Version: 2.11.1
2728
Date: April 5th 2025

0 commit comments

Comments
 (0)