From fcd2f756991b928926589c3a95e9862869b599e1 Mon Sep 17 00:00:00 2001 From: notnotmelon Date: Sat, 19 Oct 2024 16:42:23 -0500 Subject: [PATCH] Add quality module category if it does not exist --- data-final-fixes.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 0228c6a..95e5bf7 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -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 @@ -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