diff --git a/info.json b/info.json index cbd50ae..751c3f9 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "boxing-2", - "version": "2.0.1", + "version": "2.0.2", "title": "Boxing 2", "author": "AndrolGenhald", "description": "Pack items into boxes to store more of them.", diff --git a/prototypes/item/groups.lua b/prototypes/item/groups.lua index 9f4dd7c..3400f2d 100644 --- a/prototypes/item/groups.lua +++ b/prototypes/item/groups.lua @@ -60,55 +60,57 @@ end --]] for subgroupName,t in pairs(boxing.subgroups) do - local groupName = data.raw["item-subgroup"][subgroupName].group; - local groupOrder = data.raw["item-group"][groupName].order; - local subgroupOrder = data.raw["item-subgroup"][subgroupName].order; - data:extend({ - { - type = "item-subgroup", - name = "boxing-wooden-" .. subgroupName, - --group = "box-wooden", - group = "boxing", - order = "b[boxing]-a[wooden]" .. groupOrder .. subgroupOrder, - }, - { - type = "item-subgroup", - name = "unboxing-wooden-" .. subgroupName, - --group = "unbox-wooden", - group = "boxing", - order = "c[unboxing]-a[wooden]" .. groupOrder .. subgroupOrder, - }, - { - type = "item-subgroup", - name = "boxing-steel-" .. subgroupName, - --group = "box-steel", - group = "boxing", - order = "b[boxing]-b[steel]" .. groupOrder .. subgroupOrder, - }, - { - type = "item-subgroup", - name = "unboxing-steel-" .. subgroupName, - --group = "unbox-steel", - group = "boxing", - order = "c[unboxing]-b[steel]" .. groupOrder .. subgroupOrder, - }, - }); - if boxing.tungsten then + if data.raw["item-subgroup"][subgroupName] then + local groupName = data.raw["item-subgroup"][subgroupName].group; + local groupOrder = data.raw["item-group"][groupName].order; + local subgroupOrder = data.raw["item-subgroup"][subgroupName].order; data:extend({ { type = "item-subgroup", - name = "boxing-tungsten-" .. subgroupName, - --group = "box-tungsten", + name = "boxing-wooden-" .. subgroupName, + --group = "box-wooden", + group = "boxing", + order = "b[boxing]-a[wooden]" .. groupOrder .. subgroupOrder, + }, + { + type = "item-subgroup", + name = "unboxing-wooden-" .. subgroupName, + --group = "unbox-wooden", + group = "boxing", + order = "c[unboxing]-a[wooden]" .. groupOrder .. subgroupOrder, + }, + { + type = "item-subgroup", + name = "boxing-steel-" .. subgroupName, + --group = "box-steel", group = "boxing", - order = "b[boxing]-c[tungsten]" .. groupOrder .. subgroupOrder, + order = "b[boxing]-b[steel]" .. groupOrder .. subgroupOrder, }, { type = "item-subgroup", - name = "unboxing-tungsten-" .. subgroupName, - --group = "unbox-tungsten", + name = "unboxing-steel-" .. subgroupName, + --group = "unbox-steel", group = "boxing", - order = "c[unboxing]-c[tungsten]" .. groupOrder .. subgroupOrder, + order = "c[unboxing]-b[steel]" .. groupOrder .. subgroupOrder, }, }); + if boxing.tungsten then + data:extend({ + { + type = "item-subgroup", + name = "boxing-tungsten-" .. subgroupName, + --group = "box-tungsten", + group = "boxing", + order = "b[boxing]-c[tungsten]" .. groupOrder .. subgroupOrder, + }, + { + type = "item-subgroup", + name = "unboxing-tungsten-" .. subgroupName, + --group = "unbox-tungsten", + group = "boxing", + order = "c[unboxing]-c[tungsten]" .. groupOrder .. subgroupOrder, + }, + }); + end end end