fix for k2 stack size unchanged

This commit is contained in:
Brevven 2021-02-28 20:27:27 -08:00
parent 47453164a4
commit 69e6fc798e
6 changed files with 15 additions and 6 deletions

View file

@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.2.2
Date: 2021-01-29
Fixes:
- K2 stack size fix for no changes
---------------------------------------------------------------------------------------------------
Version: 0.2.1
Date: 2021-01-27
Fixes:

View file

@ -1,6 +1,6 @@
{
"name": "bzlead",
"version": "0.2.1",
"version": "0.2.2",
"factorio_version": "1.1",
"title": "Lead",
"author": "Brevven",

View file

@ -17,7 +17,7 @@ data:extend(
},
subgroup = "raw-material",
order = "e05-a[enriched-ores]-a1[enriched-lead]",
stack_size = util.get_k2_stack_size(),
stack_size = util.get_stack_size(100)
},
{
type = "recipe",

View file

@ -76,7 +76,7 @@ data:extend({
},
subgroup = "raw-resource",
order = "t-c-a",
stack_size = (mods["Krastorio2"] and util.get_k2_stack_size() or 50)
stack_size = util.get_stack_size(50)
},
})

View file

@ -59,7 +59,7 @@ data:extend(
icon_size = 64,
subgroup = "raw-material",
order = "b[lead-plate]",
stack_size = (mods["Krastorio2"] and util.get_k2_stack_size() or 100)
stack_size = util.get_stack_size(100)
},
}
)

View file

@ -3,8 +3,12 @@ local util = {}
util.lead_ore = "lead-ore"
util.lead_plate = "lead-plate"
function util.get_k2_stack_size()
return tonumber(krastorio.general.getSafeSettingValue("kr-stack-size"))
function util.get_stack_size(default)
if mods["Krastorio2"] then
size = tonumber(krastorio.general.getSafeSettingValue("kr-stack-size"))
return size or default
end
return default
end
-- check if a table contains a sought value