fix recycling with deadlock

This commit is contained in:
Brevven 2025-01-15 16:02:11 -08:00
parent ac090d05b1
commit 0490de093a
3 changed files with 7 additions and 2 deletions

View file

@ -944,7 +944,7 @@ end
-- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true.
function util.replace_ingredient(recipe_name, old, new, amount, multiply, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) and (data.raw.item[old] or data.raw.fluid[old]) then
me.add_modified(recipe_name)
prepare_redo_recycling(recipe_name)
replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply)