Bug - Fixed use * not working any more when limited by spleen

Crowther

Active member
I swear this used to work right, but I've no idea when it changed. Mafia correctly decides to only use one dream jar, then claims to be using it, but doesn't.
> use * dream jar

(usable quantity of Unconscious Collective Dream Jar (3) is limited to 1 by spleen)
Using 1 Unconscious Collective Dream Jar...
Finished using 1 Unconscious Collective Dream Jar.

> use 1 dream jar

Using 1 Unconscious Collective Dream Jar...
You gain 9 Adventures
You gain 25 Fortitude
You gain 27 Wizardliness
You gain 23 Cheek
Finished using 1 Unconscious Collective Dream Jar.
 

Veracity

Developer
Staff member
When it makes the request, it sees that the item is multiusable and that you want to use more than one, so it tries to use multiuse.php. When it limits you to 1, it sets the amount used to be 1, but leaves it at multiuse.php. And then, later, when it wants to add the fields to use the correct number of items, it sees that you are using only one and doesn't add them - because it assumes it is going to inv_use.php, which doesn't allow or require a count field.

I think that if we reduce consumption to 1 from something higher, we should switch to inv_use.php.

> get currentSpleenUse

0

> inv dream jar

Unconscious Collective Dream Jar (78)

> use 2 dream jar

Using 2 Unconscious Collective Dream Jar...
You gain 14 Adventures
You gain 58 Strengthliness
You gain 48 Enchantedness
You gain 76 Smarm
Finished using 2 Unconscious Collective Dream Jar.

> use * dream jar

(usable quantity of Unconscious Collective Dream Jar (76) is limited to 1 by spleen)
Using 1 Unconscious Collective Dream Jar...
You gain 5 Adventures
You gain 24 Muscleboundness
You gain 25 Wizardliness
You gain 29 Chutzpah
Finished using 1 Unconscious Collective Dream Jar.

> get currentSpleenUse

12
That works. Revision 14238.

Note that if there are multiusable items which are not spleen items but which are limited, a similar fix should be done to UseItemRequest. I don't feel like looking to find such an item, at the moment, to verify such a fix, so I did not do it.
 

Veracity

Developer
Staff member
Ha. Well, restorative items are multiusable, but we use limit them to keep from wasting them.

> use 2 ailment ointment

(usable quantity of Doc Galaktik's Ailment Ointment (2) is limited to 1 by needed restoration)
Using 1 Doc Galaktik's Ailment Ointment...
Finished using 1 Doc Galaktik's Ailment Ointment.
It didn't actually use it. Applying the same fix:

> use 2 ailment ointment

(usable quantity of Doc Galaktik's Ailment Ointment (2) is limited to 1 by needed restoration)
Using 1 Doc Galaktik's Ailment Ointment...
You gain 8 hit points
Finished using 1 Doc Galaktik's Ailment Ointment.
Revision 14239.
 

Crowther

Active member
Yeah, it was. I tried to follow that code before reporting and thought maybe it had to do with multi vs single use, but couldn't see why that would break anything. The idea of testing with healing items was brilliant. Thanks.
 
Top