diff --git a/items.lua b/items.lua index e8dfcf9..b3fda2f 100644 --- a/items.lua +++ b/items.lua @@ -178,9 +178,9 @@ local function checkField(base, check) if type(base) == "function" then return base(check) end - + local baseType = type(base) - if baseType == nil then + if baseType == "nil" then return true elseif baseType ~= type(check) then return false @@ -203,10 +203,10 @@ end function FILTER_MATCHING_SLOTS(target) return function(detail) - return target == nil or (checkField(target.name, detail.name) and + return detail ~= nil and (target == nil or (checkField(target.name, detail.name) and checkField(target.displayName, detail.displayName) and checkField(target.damage, detail.damage) and - checkField(target.enchantments, detail.enchantments)) + checkField(target.enchantments, detail.enchantments))) end end