Bug - Fixed Fuzzy matching for "potion of detection" broken

coandco

Member
I just updated my copy of KoLMafia from v16339 to v16379, and now the CLI command "use potion of detection" no longer works. Oddly enough, "use potion of detect" works fine...

Code:
> use potion of detection

[potion of detection] has no matches.

> use potion of detect

Using 1 milky potion of detection...
You acquire an effect: Object Detection (10)
Finished using 1 milky potion of detection.
 
Last edited:

Darzil

Developer
I think this has appeared due to the filter changes (ie making them work) needed to fix the ghost dog chow bug.

Basically potion of detection is in the canonical name list, but not the item Id by name list. milky potion of detection is on both lists, so that should also work.

Am looking at it.
 

Darzil

Developer
Actually, I'm wrong. It is in the item Id by name list, but that returns -1, which we usually use for not found.
I think perhaps we need to be updating that list when an item is identified, rather than just the canonical name list. Will look into where we do that.
 

Darzil

Developer
r16383 updates the base name when the item is identified with the right item Id.

It will not be found if the potion has not yet been identified.
 

Darzil

Developer
Yes, they should be removed as they are user aliases by ItemDatabase.miniReset().

Hmm, actually, I think we should move addPseudoItems() to after that section, or they'll get removed again. Have done that in r16384.

The base names (potion of detection for example) don't look ever to have been removed, they'd always have returned -1 on an item lookup. They were 'saved' by the fact that as an exact match there would be only one item in the list so the filter would have returned them regardless of setting, and that fuzzy matches preferred to match to bubbly potion of detection rather than potion of detection.

I'm still a little uncertain whether making the filter work was the best solution, or whether I should have instead try to do the much thought about item numbers for everything change, which I think should included bang potions and slime vials. That is a much larger project of course, which is why we've never done it.
 
Top