Fix Admin Vendors selling tools causing 'attempt to index local 'from_table' (a nil value)'

master
ChimneySwift 2018-12-18 13:24:29 +10:00
parent 876cd84c85
commit ed26606935
1 changed files with 1 additions and 1 deletions

View File

@ -405,7 +405,7 @@ local function inv_insert(inv, listname, itemstack, quantity, from_table, pos, i
table.insert(stacks, {name = itemstack:get_name(), count = remaining_quantity})
-- If tool add wears and metadatas, ignores if from_table = nil (eg, due to vendor beig admin vendor)
if minetest.registered_tools[itemstack:get_name()] then
if minetest.registered_tools[itemstack:get_name()] and from_table then
for i in pairs(stacks) do
local from_item_table = from_table[i].item:to_table()
stacks[i].wear = from_item_table.wear