danreeves / dt-exchange

40 stars 17 forks source link

Filters provided as an array override requirements inside the whole rule #44

Closed Coconutcoo closed 1 year ago

Coconutcoo commented 1 year ago

A filter like

[
    {
        "Item": "Crucis Mk II Thunder Hammer",
        "blessing": [
            "Momentum",
            "Thrust"
        ],
        "minStats": 340
    }
]

Will match items that have anything that would match the blessing "Momentum" or "Thrust", since that array is handled as an "OR" without regard to the other filters. E.g. image

My understanding is the logic above should essentially look for Item is X && Blessing in [A,B] && minStats > Y

It's acting more like (Item is X && minStats > Y) || Blessing is A || Blessing is B

kuanoni commented 1 year ago

It's because the "Item" in your filter is capitalized. In the filter function it checks item names against target.item. Change it to "item" and it works fine.