What does the return value of drink() mean?

dj_d

Member
I thought it would return true if you drank the drink successfully, but...

Code:
> ash print(drink(1,$item[roll in the hay]));

Drinking 1 roll in the hay...
You gain 11 Adventures
You gain 43 Enchantedness
You gain 4 Drunkenness
Finished drinking 1 roll in the hay.
false
 

jasonharper

Developer
Most ASH functions with boolean results return false if there was an error, or a "pending state". In the context of adventuring, that means that things ended early for some reason - out of adventures, conditions satisfied, hit a stop adventure/glyph/demon name, etc. I have no idea what it means for item usage.
 

Bale

Minion
[quote author=jasonharper link=topic=2146.msg11019#msg11019 date=1231764068]
I have no idea what it means for item usage.
[/quote]

I would also dearly love to know the answer to this. I was assuming when I wrote a script that use(item) would return true if the item was successfully used. Finally I figured out that bug.
 

dj_d

Member
What's particularly weird is that for a long time this returned true (eatdrink.ash depended on it) and the behavior seemed to change recently, perhaps around the time I upgraded to the most current build. Maybe the behavior changed/broke within the last two weeks?
 
Top