From 503f02424e8301bf353268ea5cb8e9e107162858 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 8 May 2023 21:13:28 +0900 Subject: [PATCH] Update data.lua --- PHI-RS/data.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/PHI-RS/data.lua b/PHI-RS/data.lua index 26c5aea..8679258 100644 --- a/PHI-RS/data.lua +++ b/PHI-RS/data.lua @@ -291,12 +291,7 @@ local recipe_list = { }, } -local module_limitation = table.deepcopy(data.raw.module['productivity-module']['limitation']) -local module_limitation_key = {} -for k, v in pairs(module_limitation) do - module_limitation_key[v] = k -end for i=1, #recipe_list, 1 do if data.raw.recipe[recipe_list[i].name] ~= nil then @@ -401,10 +396,6 @@ for i=1, #recipe_list, 1 do end end - if module_limitation_key[item.name] ~= nil then - table.insert(module_limitation, item.name .. '-s' .. j) - end - item.name = item.name .. '-s' .. j data:extend({item}) @@ -413,9 +404,17 @@ for i=1, #recipe_list, 1 do end end +local module_limitation = table.deepcopy(data.raw.module['productivity-module']['limitation']) + for _, v in pairs(data.raw.module) do if v.limitation and string.find(v.name, 'productivity', 1, true) then - v.limitation = module_limitation + for j=1, #recipe_multiplier, 1 do + for k, _ in pairs(module_limitation) do + if data.raw.recipe[module_limitation[k] .. '-s' .. j] ~= nil then + table.insert(v.limitation, module_limitation[k] .. '-s' .. j) + end + end + end end end