Original Post — Direct link

/u/RhysGGG Sorry to directly summon you here but I'm guessing this post will probably get buried due to it not being typical Reddit material.

I've been doing some experimenting with the HasExplicitMod condition and its ability to have numerical operators as of 3.14. I'm finding that some of the operators have unexpected results. I ran a sequence of checks against two items: one that had both mods used in the rule, and one that had neither. I did this with all combinations of operators and numbers up to 3. Here are the results:

https://preview.redd.it/oxfgm1w9rjc81.png?width=3550&format=png&auto=webp&s=eff6a9e19655fa8d8b95c2e520f39b24eea80e16

The green cells are all expected results, the red cells are unexpected, and for white I wasn't sure what to expect. Could you confirm what I'm concluding from these results:

  1. If a rule is missing either the numeric value or is only numeric (no operator), the operator is ignored and the comparison is treated like the default fuzzy match?
  2. The >, <, and <= operators are not working as expected, and may in fact be running the opposite comparisons.

Much thanks Rhys (or anyone else) if you're able to clarify what's happening here!

External link →
over 2 years ago - /u/RhysGGG - Direct link

Hi, thanks for the detailed investigation.

  1. If the operator is not present, then the token is parsed as a non-quoted string match, but since there are no mod names containing "0" (or other numbers) it doesn't have any effect.

  2. Those three operators are indeed backwards. Will fix.

Cheers!

over 2 years ago - /u/RhysGGG - Direct link

Originally posted by NeverSinkDev

I've never used the numbers only syntax but that's a good find!

FYI it's not really something useful. The number is treated as an unquoted mod string, not an operator. So HasExplicitMod 0 "Energy Shield" is equivalent to HasExplicitMod "0" "Energy Shield", but since the string "0" doesn't match any Mods there isn't much point.