Skip to content

Commit

Permalink
Ensure modified assembling_machine_list is returned to caller
Browse files Browse the repository at this point in the history
Resolves pyanodon/pybugreports#732
Thanks <@66281942261182464> for the report
  • Loading branch information
oorzkws committed Nov 18, 2024
1 parent ef384bc commit ec1abea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions scripts/turd/turd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -406,14 +406,15 @@ 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)
storage.turd_unlocked_modules[force.index] = {}
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

Expand Down

0 comments on commit ec1abea

Please sign in to comment.