[invtweak] Fix strange crash with wielders

This commit is contained in:
LeMagnesium 2015-10-14 14:49:44 +02:00
parent 13974157c2
commit be6f213b8a
1 changed files with 9 additions and 7 deletions

View File

@ -194,6 +194,7 @@ 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
if inv:get_list("main") then
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)
@ -203,6 +204,7 @@ function refill(player, stck_name, index)
return
end
end
end
end
if auto_refill == true then