Skip to content

Commit

Permalink
Skip prod blacklist for single-result item recipes (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
oorzkws authored May 16, 2024
1 parent 4f5736e commit 832afa5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.24
Date: 2024-??-??
Bugfixes:
- Fix productivity blacklist being overly general and including recipes like empty barrels
---------------------------------------------------------------------------------------------------
Version: 0.2.23
Date: 2024-4-25
Changes:
Expand Down
19 changes: 11 additions & 8 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,17 @@ for _, recipe in pairs(data.raw.recipe) do
recipe.result = nil
recipe.result_count = nil
end
for i, result in pairs(recipe.results) do
local name = result.name or result[1]
local amount = result.amount or result[2]
if name and config.NON_PRODDABLE_ITEMS[name] and not result.catalyst_amount then
if result[1] then
recipe.results[i] = {type = result.type or 'item', name = name, amount = amount, catalyst_amount = amount}
else
result.catalyst_amount = amount
-- Skip if recipe only produces the item, not uses it as a catalyst. Fluids are probably blacklisted for other reasons.
if #recipe.results ~= 1 or recipe.results[1].type ~= 'fluid' then
for i, result in pairs(recipe.results) do
local name = result.name or result[1]
local amount = result.amount or result[2]
if name and config.NON_PRODDABLE_ITEMS[name] and not result.catalyst_amount then
if result[1] then
recipe.results[i] = {type = result.type or 'item', name = name, amount = amount, catalyst_amount = amount, [1] = nil, [2] = nil}
else
result.catalyst_amount = amount
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pypostprocessing",
"version": "0.2.23",
"version": "0.2.24",
"factorio_version": "1.1",
"title": "Pyanodons Post-processing",
"author": "Pyanodon, Shadowglass",
Expand Down

0 comments on commit 832afa5

Please sign in to comment.