From 4f145a991c9c71815431754e509593102d65f9b7 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Wed, 25 Sep 2024 10:58:42 +0000 Subject: [PATCH] Fix detail matching --- items.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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