Bug Scratch 'n' Sniff Weapon is not considered by maximizer if it has a negative bonus

Reproduction steps:
Have a scratch n sniff weapon with 3 unicorn stickers on it (75% item drop)
Have no weapon equipped
Run the maximizer with the string
Code:
5.0 item, -1.0 bonus scratch 'n' sniff sword,  373 bonus june cleaver, -equip broken champagne bottle

It will choose the June Cleaver (score of 373) over the scratch n sniff weapon (Should be expected score of 374)

Trying again to see that positive bonuses work:
Have a scratch n sniff weapon with 3 unicorn stickers on it (75% item drop)
Have no weapon equipped
Run the maximizer with the string
Code:
5.0 item, 1.0 bonus scratch 'n' sniff sword,  375 bonus june cleaver, -equip broken champagne bottle

It will now choose the scratch n sniff weapon (score of 376) over the 375 score of june cleaver
 

heeheehee

Developer
Staff member
https://github.com/kolmafia/kolmafi...forge/kolmafia/maximizer/Evaluator.java#L1531 is to blame -- the score directly associated with the scratch 'n' sniff sticker sword is -1, so it gets ruled out before we even consider its special handling.

The obvious fix (don't exclude items with special handling, even if their score is nominally negative) would also increase maximizer execution time. It's probably the correct approach, but I'm curious if anyone else has thoughts on this.
 
For what it's worth, my understanding is that it'll only increase execution time in situations where a negative bonus is assigned, and I think people will only assign a negative bonus if they actively don't want to -equip the item. So I'd be inclined to change this.

If it would increase execution time outside of that scenario, that's another problem and I would be much more hesitant to make the change.
 
Top