allow partial rules for specific item types

This commit is contained in:
Héctor Giménez
2024-05-05 13:43:19 +09:00
parent 753f303978
commit 638f3047f8
3 changed files with 15 additions and 5 deletions

View File

@@ -156,6 +156,12 @@ func (r Rule) Evaluate(it data.Item) (RuleResult, error) {
continue
}
if itemTypes, found := blockedStatsForItemType[statName[0]]; found {
if slices.Contains(itemTypes, it.TypeAsString()) {
return RuleResultNoMatch, fmt.Errorf("property %s is not supported for item type %s", statName[0], it.TypeAsString())
}
}
layer := 0
if len(statData) > 1 {
layer = statData[1]