In the process of fixing a divide by zero error there was some discussion of quantum tacos. See https://kolmafia.us/threads/divide-...tum-taco-consuming-astral-energy-drink.28941/ and https://github.com/kolmafia/kolmafia/pull/1759
The focus was on EatItemRequest.maximumUses(...) which in most cases just computes how many of an item can be eaten using the current available space and the fullness of an item. AFAIK the returned value is not really visible to users or scripts. It is used to determine some aspects of the Item Manager consumption display and when actually making a request to KoL.
Quantum tacos have zero fullness, currently, which is how they got involved in the divide by zero discussion and fix. But you cannot actually eat a QT according to KoL unless you have 2 fullness available. The amount of fullness actually used is random.
There was a suggestion that the "correct" value of maximumUses was just the remaining fullness divided by two (and that change could be done by making the entry in fullness.txt 2 instead of 0). But no matter what the value of maximumUses is, any kind of loop using it while consuming will have to recompute the value after every taco and possibly exit.
The discussion was tabled but I said I'd try and keep it from getting lost.
Some if anyone sees anything unexpected in the consumption of QTs since r27421 then it should be reported or discussed here, at least initially
If I am wrong in how EatItemRequest.maximumUses(...) is used and how that usage would be visible to the user then there should be a discussion of the right answer.
But for the moment I am just keeping the discussion available since my personal opinion is that the status quo since r27421 is acceptable.
The focus was on EatItemRequest.maximumUses(...) which in most cases just computes how many of an item can be eaten using the current available space and the fullness of an item. AFAIK the returned value is not really visible to users or scripts. It is used to determine some aspects of the Item Manager consumption display and when actually making a request to KoL.
Quantum tacos have zero fullness, currently, which is how they got involved in the divide by zero discussion and fix. But you cannot actually eat a QT according to KoL unless you have 2 fullness available. The amount of fullness actually used is random.
There was a suggestion that the "correct" value of maximumUses was just the remaining fullness divided by two (and that change could be done by making the entry in fullness.txt 2 instead of 0). But no matter what the value of maximumUses is, any kind of loop using it while consuming will have to recompute the value after every taco and possibly exit.
The discussion was tabled but I said I'd try and keep it from getting lost.
Some if anyone sees anything unexpected in the consumption of QTs since r27421 then it should be reported or discussed here, at least initially
If I am wrong in how EatItemRequest.maximumUses(...) is used and how that usage would be visible to the user then there should be a discussion of the right answer.
But for the moment I am just keeping the discussion available since my personal opinion is that the status quo since r27421 is acceptable.