Skip to content

Commit

Permalink
Merge pull request #968 from Erkigmo/master
Browse files Browse the repository at this point in the history
Fix crash with Pyanodons
  • Loading branch information
KiwiHawk authored Jan 13, 2024
2 parents bce5499 + b4298d3 commit da288ea
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
5 changes: 5 additions & 0 deletions angelsrefining/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.12.7
Date: ???
Changes:
- Changed library function to handle bad input data (968)
---------------------------------------------------------------------------------------------------
Version: 0.12.6
Date: 04.01.2024
Bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion angelsrefining/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angelsrefining",
"version": "0.12.6",
"version": "0.12.7",
"factorio_version": "1.1",
"title": "Angel's Refining",
"author": "Arch666Angel",
Expand Down
34 changes: 18 additions & 16 deletions angelsrefining/prototypes/override-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -969,24 +969,26 @@ local function adjust_technology(tech, k) -- check a tech for basic adjustments
end
for i = #tech.unit.ingredients, 1, -1 do
local pack = tech.unit.ingredients[i]
local nk = pack.name and "name" or 1
local ak = pack.name and "amount" or 2
if to_remove[pack[nk]] then
table.remove(tech.unit.ingredients, i)
else
if substitution_table.science_packs[pack[nk]] then
pack[ak] = substitution_table.science_packs[pack[nk]].amount
pack[nk] = substitution_table.science_packs[pack[nk]].add
end
if modifications and modifications[pack[nk]] then
if modifications[pack[nk]] > 0 then
dup_table[pack[nk]] = true
pack[ak] = modifications[pack[nk]]
if pack then
local nk = pack.name and "name" or 1
local ak = pack.name and "amount" or 2
if to_remove[pack[nk]] then
table.remove(tech.unit.ingredients, i)
else
if substitution_table.science_packs[pack[nk]] then
pack[ak] = substitution_table.science_packs[pack[nk]].amount
pack[nk] = substitution_table.science_packs[pack[nk]].add
end
if modifications and modifications[pack[nk]] then
if modifications[pack[nk]] > 0 then
dup_table[pack[nk]] = true
pack[ak] = modifications[pack[nk]]
else
table.remove(tech.unit.ingredients, i)
end
else
table.remove(tech.unit.ingredients, i)
dup_table[pack[nk]] = true
end
else
dup_table[pack[nk]] = true
end
end
end
Expand Down

0 comments on commit da288ea

Please sign in to comment.