Skip to content

Commit 48f9c6a

Browse files
authored
fix(#465): Don't auto-calculate catalysts in Factorio 2.0. (#470)
This fixes #465 for 2.0, while preserving the auto-calculations that applied in 1.1 and earlier.
2 parents 8867511 + c72b36d commit 48f9c6a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Yafc.Parser/Data/FactorioDataDeserializer_RecipeAndTechnology.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ private void DeserializeQuality(LuaTable table, ErrorCollector errorCollector) {
5656
}
5757

5858
private void UpdateRecipeCatalysts() {
59-
foreach (var recipe in allObjects.OfType<Recipe>()) {
60-
foreach (var product in recipe.products) {
61-
if (product.productivityAmount == product.amount) {
62-
float catalyst = recipe.GetConsumptionPerRecipe(product.goods);
63-
64-
if (catalyst > 0f) {
65-
product.SetCatalyst(catalyst);
59+
if (factorioVersion < new Version(2, 0, 0)) {
60+
foreach (var recipe in allObjects.OfType<Recipe>()) {
61+
foreach (var product in recipe.products) {
62+
if (product.productivityAmount == product.amount) {
63+
float catalyst = recipe.GetConsumptionPerRecipe(product.goods);
64+
65+
if (catalyst > 0f) {
66+
product.SetCatalyst(catalyst);
67+
}
6668
}
6769
}
6870
}

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Date:
2424
- If the requested mod version isn't found, use the latest, like Factorio.
2525
- Fix amounts loaded from other pages in the legacy summary page.
2626
- Improved precision for building count calculation.
27+
- Remove automatic catalyst amount calculations when loading Factorio 2.0 data.
2728
----------------------------------------------------------------------------------------------------------------------
2829
Version: 2.11.1
2930
Date: April 5th 2025

0 commit comments

Comments
 (0)