Fix attempt to index local 'inv2' (a nil value) in chests

This commit is contained in:
kay27 2021-07-20 01:00:44 +04:00
parent 56c65b3e52
commit 894ec03442
1 changed files with 3 additions and 1 deletions

View File

@ -327,7 +327,9 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
local function limit_put(stack, inv1, inv2)
local leftover = ItemStack(stack)
leftover = limit_put_list(leftover, inv1:get_list("main"))
leftover = limit_put_list(leftover, inv2:get_list("main"))
if inv2 then
leftover = limit_put_list(leftover, inv2:get_list("main"))
end
return stack:get_count() - leftover:get_count()
end