Bug - Fixed Trying to consume multiple munchies pills from Food section of the Item Manager fails

lostcalpolydude

Developer
Staff member
When using the Food section of the Item Manager to try to consume more than 1 munchies pills, action=useitem never gets added to the request. Mafia thinks it consumed them anyway. Consuming 1 works. I don't have the creation queue enabled, if that matters (I don't think it does, though).

Between UseItemEnqueuePanel, EatItemRequest, and UseItemRequest, I don't really know where to try making a change.
 

Veracity

Developer
Staff member
ConcoctionDatabase.handleQueue( ..., KoLConstants.CONSUME_EAT ) will "eat" things from the Food section.
ConcoctionDatabase.consumeItem( <munchies pill>, <n>, KoLConstants.CONSUME_EAT ) will "eat" the munchies pills
UseItemRequest.getInstance( KoLConstants.CONSUME_EAT, <n munchies pills> ) will make the request to "eat" the munchies pills.
Since consumptionType is KoLConstants.CONSUME_EAT, it does a new EatItemRequest( <n munchies pill> )
That, in turn, does super( ItemDatabase.getConsumptionType( item.getItemId() ), item ), which results in
UseItemRequest( KoLConstants.CONSUME_MULTIPLE, <n munchies pill> )

That should make a request with URL of "multiuse.php?whichitem=1619", this.consumptionTpe = KoLConstants.CONSUME_MULTIPLE, and this.item <n munchie pill>.

And when the request is actually run(), since this.consumptionType is KoLConstants.CONSUME_MULTIPLE, it should add "action=useitem" and "quantity=<n>".

At least, looking at the code, that looks like how it should work. But, you are reporting that the request that is submitted is simply "multiuse.php?whichitem=1619"? Not even "inv_use.php?whichitem=1619"? How odd.

I think I'll try stepping through this with Eclipse.
 

Veracity

Developer
Staff member
Heh. Well, UseItemRequest.useOnce added "action=useitem", but EatItemRequest.useOnce did not.
Revision 14142
 

lostcalpolydude

Developer
Staff member
Yes, multiuse.php?whichitem=1619&ajax=1&quantity=3 is sent. UseItemRequest isn't reached until the UseItemRequest.runOneIteration call from EatItemRequest.useOnce, I think.

Edit: And apparently I was too slow.
 
Top