Skip to content

Commit

Permalink
Add quality module category if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Oct 19, 2024
1 parent a1f7ea9 commit fcd2f75
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,20 @@ for _, drill in pairs(data.raw["mining-drill"]) do
end
end

if not data.raw["module-category"]["quality"] then
data:extend {{
type = "module-category",
name = "quality"
}}
end

local default_mods = {"productivity", "speed", "efficiency", "quality"}
for _, value in pairs {"furnace", "assembling-machine", "mining-drill", "lab", "beacon", "rocket-silo"} do
for _, prototype in pairs(data.raw[value]) do
prototype.allowed_module_categories = prototype.allowed_module_categories or default_mods
end
end

-- remove for logging unused attributes
for _, category in pairs(data.raw) do
for _, prototype in pairs(category) do
Expand All @@ -387,10 +401,3 @@ for _, category in pairs(data.raw) do
end

if dev_mode then require "tests.data" end

local default_mods = {"productivity", "speed", "efficiency", "pollution", "quality"}
for _, value in pairs {"furnace", "assembling-machine", "mining-drill", "lab", "beacon", "rocket-silo"} do
for _, prototype in pairs(data.raw[value]) do
prototype.allowed_module_categories = prototype.allowed_module_categories or default_mods
end
end

0 comments on commit fcd2f75

Please sign in to comment.