Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Version: 3.0.40
Date: ????
Changes:
- Added unsafe modes for recipe functions, allowing the alteration of recipes regardless if the items/fluids exist.
- Add compatibility with AAI Signal Transmission. Now researched after
logistics science and uses contemporary ingredients
- Add compatibility with AAI Signal Transmission. Now researched after logistics science and uses contemporary ingredients
- Adjusted logic that determines the amount and name of a product to display with the "Add recipe signals" startup setting.
---------------------------------------------------------------------------------------------------
Version: 3.0.39
Date: 2025-09-15
Expand Down
27 changes: 15 additions & 12 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,26 @@ if create_signal_mode then
break
end
-- Determine amount of main product to display in signal name
amt = 0
local amt = 0
local main_product_name = recipe:get_main_product(true).name
for _, result in pairs(recipe.results) do
if result.name then
local is_main_product = recipe.main_product and result.name == recipe.main_product
if is_main_product and result.probability and result.probability < 1 then
amt = result.probability
if result.name == main_product_name then
if result.probability and result.probability < 1 then
-- Some recipes have random amount for multiples, such as nuclear isotopes.
local prob_amt = 0
if result.amount then
prob_amt = result.amount
elseif result.amount_min and result.amount_max then
prob_amt = (result.amount_min + result.amount_max) / 2
end
amt = result.probability * prob_amt
break
elseif is_main_product and result.amount_min and result.amount_max then
elseif result.amount_min and result.amount_max then
amt = (result.amount_min + result.amount_max) / 2
break
elseif result.amount then
if is_main_product then
amt = result.amount
break
end
-- Fallback that determines main product based on highest output
amt = math.max(amt, result.amount)
amt = result.amount
break
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": "3.0.39",
"version": "3.0.40",
"factorio_version": "2.0",
"title": "Pyanodons Post-processing",
"author": "Pyanodon, Shadowglass, LambdaLemon",
Expand Down
2 changes: 1 addition & 1 deletion lib/metas/recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,4 @@ metas.get_icons = function(self)
error(string.format("Couldn't find icons for recipe %s", self.name))
end

return metas
return metas
2 changes: 1 addition & 1 deletion locale/zh-CN/pypostprocessing.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#汉化:aotix
#汉化:aotix

[mod-name]
pypostprocessing=Py之后期处理
Expand Down