Bug - Fixed r8868 - buying TPS drinks instead of creating them?

Glazius

Member
I have a tiny plastic sword, and I've noticed that with r8868, if I don't have the appropriate fruit to make a TPS drink, when I try to drink it (as in "drink bodyslam" in the CLI with no limes) Mafia will try to buy the drink, rather than buying the fruit and making the drink. This doesn't happen when I try to create it (as in "create bodyslam" in the CLI).

This doesn't seem like consistent behavior, and as far as I can remember wasn't happening before. My kitchen's got a bartender and a Queue de Coq, so it's not like I can't make the drink for free.
 

Aankhen

Member
I can confirm this. Started yesterday, so just a few revisions ago, I think. Seems to be happening pretty consistently for me. Sample from r8870:
Code:
> drink 3 cherry bomb

Since you are not in a Moxie sign, you may not visit the brewery.
Searching for "cherry bomb"...
Searching for "old-fashioned"...
Searching for "bottle of whiskey"...
Searching for "fermenting powder"...
Searching for "cob of corn"...
Searching for "cherry"...
Searching for "skewered cherry"...
Verifying ingredients for cherry bomb (1)...
Using cached search results for old-fashioned...
Purchasing old-fashioned (1 @ 1,555)...
You acquire an item: old-fashioned
Purchases complete.
Using cached search results for skewered cherry...
Stopped purchasing skewered cherry @ 33,000,000.
You need 1 more skewered cherry to continue.
Doesn’t really make any sense given these prices:
Code:
> prices old-fashioned, bottle of whiskey, fermenting powd, cob of corn, cherry, skewered cherry

bottle of whiskey: 122
cherry: 1,300
cob of corn: 300
fermenting powder: 70
old-fashioned: 1,555
skewered cherry: 33,000,000
I have a chef and a clockwork bartender, if that helps.

EDIT:
If I buy the cherries in advance, it creates the drinks and everything is fine.
 

xKiv

Active member
You probably had some of the *other* ingredient (grog, dry martini, sangria, ...). AFAIK, mafia consistently doesn't even try crafting if it doesn't see any direct ingredients in your inventory.
 

Bale

Minion
I'm going to chime in here. I've got a character with a TPS. That character has a script that first purchases 2x (cherry, lime, jumbo olive) and then tries to drink x of the appropriate drink. For the last two days that has regularly failed since it decided to purchase the finished cocktail instead of creating it. I explicitly purchase the misers to ensure that creation works reliably, but now I had to insert an explicit create step to make the script work.
 

xKiv

Active member
The last commit that even looks like it can have anything to do with this is:


r8852 | jasonharper | 2010-12-25 17:58:42 +0000 (Sat, 25 Dec 2010) | 5 lines
Reinstate concoction refresh speedup from r8840 - it should no longer hang.
 

jasonharper

Developer
I suspect that this was due to a temporary pricing anomaly; if the historical price for the TPS was somehow higher than the mall price for the skewered fruit or final drinks, the buy/create code probably thought it was doing you a favor by not using your TPS. The changes in 8840/8852 are unlikely to be related, they're the kind of thing that would screw up EVERYTHING, not just one item.

r8873 makes any TPS in inventory valued at zero for the purposes of calculating creation cost, since you get it back - I suspect that this will fix the problem. If it doesn't, you can now do:
set debugBuy = true
to dump the calculated purchase/creation prices when a decision is being made, which will hopefully shed light on the problem.
 
Top