summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLNJ <git@lnj.li>2017-03-26 22:22:32 +0200
committerLNJ <git@lnj.li>2017-03-26 22:22:32 +0200
commit1b280c54421ed5a4decc8d9799c2839355eef5f2 (patch)
tree5f1de3a0946a2cdde107d3324c289f43fa5f113a
parente784ad6a17b376baa2f26dc7eb542cfcfbc7b673 (diff)
Fix 'automatic tool repair' bug, Don't add stack_max=1 items
-rw-r--r--init.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 0edad10..62837ae 100644
--- a/init.lua
+++ b/init.lua
@@ -165,13 +165,19 @@ core.register_entity("drawers:visual", {
if add_name ~= name then return end
else -- is empty
name = add_name
- meta:set_string("name", name)
count = 0
-- get new stack max
base_stack_max = ItemStack(name):get_stack_max()
- meta:set_int("base_stack_max", base_stack_max)
max_count = base_stack_max * stack_max_factor
+
+ -- Don't add items stackable only to 1
+ if base_stack_max == 1 then
+ return
+ end
+
+ meta:set_string("name", name)
+ meta:set_int("base_stack_max", base_stack_max)
meta:set_int("max_count", max_count)
end