Bug - Fixed Item Manager causes infinite loop when casting Ode To Booze

With the last few builds of Mafia, and the main 14.2 base, whenever I use the Item Manager screens of either General->Booze or Usable->Booze to drink items, they will queue up, and then start an infinite cycle of Casting Ode To Booze->Maximum AT Songs until I press Stop Now (the information appears in the info line below this button). It then asks me if I want to drink without Ode To Booze. Saying yes will drink properly.

If anyone needs a log report to see what is up, or my settings, please let me know. It works eventually, it is just irritating. TIA
 
The question is, if maximum AT buffs are available, what should the code do? Should it not alert you that you're asking for sub-optimal consumption and losing 14/19 adventures, should it automatically eject one of your AT buffs, or should the current behaviour or some form of it continue?

I think likely the best is the third, but to stop trying to run the queue once you tell it that you don't want to continue...
 
As coded, it was intended to loop, adding turns of Ode, until it either had enough, you ran out of MP, or KoLmafia said "you can't continue". The expectation was that the "already at max AT buff" message would say that you couldn't continue. Looking at it, that is one of various ways that casting a skill can fail that is not, for some reason, considered a reason to stop. Perhaps Buffbots need it the way it is.

Having stopped casting Ode, for one of the above reasons, the check for "do you have enough to last through all your drinking?" check kicks in and tells you if not, allowing you to stop and manually figure out how to get more Ode, if you want it.

Revision 8644 adds "my last cast of Ode didn't actually add any turns of the effect" as a reason to stop the loop. That should take care of the problem reported in this bug report and, perhaps, other failures-to-cast, as well.
 
It works beautifully. You even put in a nice little report message instead of throwing some odd error. Excellent work, and thank you.
 
Back
Top