doadin / Baggins

zlib License
6 stars 7 forks source link

EquipmentSet "Any" rule doesn't match #38

Closed nebularg closed 4 years ago

nebularg commented 4 years ago

When the filter was refactored a conditional return was moved up, which kills the filter when you have a rule for "Any".

Fix:

--- a/src/filters/EquipmentSet.lua
+++ b/src/filters/EquipmentSet.lua
@@ -66,11 +66,6 @@
 -- Test for match
 local function Matches(bag, slot, rule)

-    -- Empty rule?
-    if not rule.sets then
-        return false
-    end
-
     -- Item belongs to a set?
     local inset, setstring = GetContainerItemEquipmentSetInfo(bag, slot)
     if not inset then
@@ -80,6 +75,11 @@
     -- Match all sets?
     if rule.anyset then
         return true
+    end
+
+    -- Empty rule?
+    if not rule.sets then
+       return false
     end

     -- Item belongs to a set in rule.sets[]?
doadin commented 4 years ago

Thanks! Fix Merged and released in v3.4.3.