Skip to content

Commit a2d2691

Browse files
author
notnotmelon
committed
fix: Fixed crash on load.
1 parent e499b93 commit a2d2691

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

data-final-fixes.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ if construction_robotics and roboport_upgrade and architecture_2 then
1515
roboport_upgrade.count = math.max(construction_robotics.count or 0, architecture_2.count or 0) + 15
1616
roboport_upgrade.time = math.max(construction_robotics.time or 0, architecture_2.time or 0) + 15
1717
local ingredients = {}
18-
for _, tech in pairs{construction_robotics, architecture_2} do
18+
for _, tech in pairs {construction_robotics, architecture_2} do
1919
for _, ingredient in pairs(tech.ingredients) do
20-
ingredients[#ingredients+1] = ingredient
20+
if type(ingredient) == "table" and type(ingredient[1]) == "string" then
21+
for _, existing in pairs(ingredients) do
22+
if existing[1] == ingredient[1] then
23+
goto dedupe
24+
end
25+
end
26+
ingredients[#ingredients + 1] = ingredient
27+
::dedupe::
28+
end
2129
end
2230
end
23-
ingredients = table.dedupe(ingredients)
2431
roboport_upgrade.ingredients = ingredients
2532
end
2633
end

0 commit comments

Comments
 (0)