Bug - Fixed Mafia not wanting to buy flat dough for creation

Theraze

Active member
This came up through using OCD Inventory Control. It wanted to make 34 jumping bean burritos, but mafia said that it didn't have enough dough. This seemed odd, because I have autoSatisfyWithNPCs enabled. It appears as if it should work from debugcreate, but...
> acquire 34 jumping bean burrito

Verifying ingredients for jumping bean burrito (34)...
You don't have enough dough.

> debugcreate 34 jumping bean burrito

- jumping bean burrito limited to 3 by flat dough
- jumping bean burrito not limited by pile of jumping beans
jumping bean burrito.canMake(1) => 3

- jumping bean burrito limited to 3 by flat dough
- jumping bean burrito not limited by pile of jumping beans
jumping bean burrito.canMake(3) => 3

- wad of dough limited to 47683 by price 50
- flat dough limited to 47683 by wad of dough
- jumping bean burrito limited to 47686 by flat dough
- jumping bean burrito limited to 39 by pile of jumping beans
jumping bean burrito.canMake(4) => 39

- wad of dough limited to 47683 by price 50
- flat dough limited to 47683 by wad of dough
- jumping bean burrito limited to 47686 by flat dough
- jumping bean burrito limited to 39 by pile of jumping beans
jumping bean burrito.canMake(39) => 39

- wad of dough limited to 47683 by price 50
- flat dough limited to 47683 by wad of dough
- jumping bean burrito limited to 47686 by flat dough
- jumping bean burrito limited to 39 by pile of jumping beans
jumping bean burrito.canMake(40) => 39

> pref npc

autoSatisfyWithNPCs (global, now 'true', default false)

> create 34 jumping bean burrito

Verifying ingredients for jumping bean burrito (34)...
You don't have enough dough.
 

Veracity

Developer
Staff member
Since flat dough costs 70 and dough costs 50, KoLmafia will never buy flat dough for creation. Instead, it is supposed to buy regular dough and roll it into flat dough (and it will require you to have a rolling pin, if you are making more than 10, since it takes a server hit to manually flatten each dough).

You already had 3 flat dough in inventory and KoLmafia needs to create 31 more. I believe that when it tries to "acquire" 31 flat dough, it tries to "acquire" 31 regular dough, it sees that you have 3 flat dough, and figures it can use those to make 3 of the flat doughs. And since we are now using flat dough to make regular dough to make flat dough, we abort the recursion with the "You don't have enough dough" message.

I bet that if you closeted (or unrolled) your 3 flat dough first, it would have worked.
 

Theraze

Active member
Well, on a different character that was still in-run, I tried to acquire a single flat dough and it gave the same failure message...
 

roippi

Developer
Oy. This bug is actually double-pronged.

Code:
> inv dough

flat dough (3)
wad of dough

> acquire 4 flat dough

Creating flat dough (1 of 1)...
Using 1 wad of dough...
You acquire an item: flat dough
Finished using 1 wad of dough.
Successfully created flat dough (1)

> inv dough

flat dough (4)

> acquire 5 flat dough

You don't have enough dough.

> acquire wad of dough

You don't have enough dough.

The inability to acquire flat dough is (essentially) the reported bug - recursively we want to buy a wad of dough and use it to get the flat dough, but the check for recursion stops us.

That last error is surprising. Turns out there's a field that gets set, CreateItemRequest.makingDough, that never gets un-set if the "don't have enough dough" error happens. So you're locked out of doing any dough manipulation until you restart your session.

I think I have a solution for both problems, it's just hellish to debug all this recursion. all this recursion.
 

roippi

Developer
r10655 represents my fourth and least elegant solution for this. It is notable for being the one that actually worked. :)
 

Theraze

Active member
Thanks! I thought it looked like it was running a bit weird. :) Looking forwards to less oddness with dough now.
 
Top