From a6f6d2e9bbf59001d6f8652e36327c40266408a8 Mon Sep 17 00:00:00 2001 From: "A. Demant" Date: Mon, 18 Feb 2019 15:45:41 +0100 Subject: [PATCH] error during adding drop_item --- api.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 73c09fa..80fa699 100644 --- a/api.lua +++ b/api.lua @@ -47,8 +47,11 @@ M.add_drop=function(name,drop_def) if drop_def.items == nil then return end - - if minetest.registered_items[drop_def.items:split(" ")[1]] == nil then + local add_item = drop_def.items + if add_item[1] ~= nil then + add_item=add_item[1] + end + if minetest.registered_items[add_item:split(" ")[1]] == nil then return end if drop_def.rarety == nil then