From 5fbf422aaf1f269c4f49296fd738d993a5fe0c72 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Sat, 15 Aug 2015 19:45:43 +0200 Subject: [PATCH] refix bug, if mores items in inv, invtweak refill --- mods/invtweak/init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/invtweak/init.lua b/mods/invtweak/init.lua index 8a86c06a..11c1498d 100755 --- a/mods/invtweak/init.lua +++ b/mods/invtweak/init.lua @@ -192,6 +192,8 @@ end -- tool break sound + autorefill function refill(player, stck_name, index) local inv = player:get_inventory() + local old_stack = inv:get_stack("main", index) + if old_stack:get_name() == stck_name then return end for i,stack in ipairs(inv:get_list("main")) do if i ~= index and stack:get_name() == stck_name then inv:set_stack("main", index, stack)