diff --git a/changelog.txt b/changelog.txt index 4ee71202..8c51fb2d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Date: ? Changes: - Fixed digosaurs pywiki page missing [item=dried-meat] → 1 ore info. Resolves https://github.com/pyanodon/pybugreports/issues/725 - Fixed a crash when clicking on the "Unavaliable" button in the fish TURD while dousing pumps is selected. + - Fixed a crash migrating TURDs --------------------------------------------------------------------------------------------------- Version: 3.0.23 Date: 2024-11-17 diff --git a/scripts/turd/turd.lua b/scripts/turd/turd.lua index d51d7c07..4e5939f8 100644 --- a/scripts/turd/turd.lua +++ b/scripts/turd/turd.lua @@ -386,7 +386,7 @@ end local function apply_turd_bonus(force, master_tech_name, tech_upgrade, assembling_machine_list) local turd_bonuses = storage.turd_bonuses[force.index] or {} local selection = turd_bonuses[master_tech_name] or NOT_SELECTED - if selection == NOT_SELECTED then return end + if selection == NOT_SELECTED then return assembling_machine_list end local sub_tech = tech_upgrade.sub_techs[selection] local recipes = force.recipes @@ -406,6 +406,7 @@ local function apply_turd_bonus(force, master_tech_name, tech_upgrade, assemblin storage.turd_machine_replacements[force.index][effect.old] = effect.new end end + return assembling_machine_list end local function reapply_turd_bonuses(force) @@ -413,7 +414,7 @@ local function reapply_turd_bonuses(force) local assembling_machine_list = find_all_assembling_machines(force) for master_tech_name, tech_upgrade in pairs(tech_upgrades) do - apply_turd_bonus(force, master_tech_name, tech_upgrade, assembling_machine_list) + assembling_machine_list = apply_turd_bonus(force, master_tech_name, tech_upgrade, assembling_machine_list) end end