Bug - Fixed If you're out of clovers, "acquire ten-leaf" is handled... oddly.

> acquire ten-leaf

Searching for "ten-leaf clover"...
Search complete.
Purchasing ten-leaf clover (1 @ 1,880)...
You acquire an item: ten-leaf clover
Using 1 ten-leaf clover...
You acquire an item: disassembled clover
Finished using 1 ten-leaf clover.
Purchases complete.
Verifying ingredients for ten-leaf clover (1)...
Creating ten-leaf clover (1)...
You acquire an item: ten-leaf clover
Successfully created ten-leaf clover (1)

After buying it, Mafia disassembles the clover, then immediately reassembles it.
e:And then after I wrote up this bug report it re-disassembled the clover when I wasn't looking.

I'm not sure whether the policy is that "ten-leaf" means a request for an intact clover or that all clovers should be disassembled when obtained, but this doesn't really work for either.
 

Veracity

Developer
Staff member
You have clover protection active.

Clover protection, as designed, disassembles all new ten-leaf clovers that enter your inventory, whether via adventuring, the hermit, the barrels, the shore, the mall, or from a 31337 scroll.

The "acquire" command saw that it would have to buy a clover to get one. It did so. Clover protection kicked in and disassembled it. The acquire command then saw that it could create a clover by using a disassembled clover. It did so. Since "using a disassembled clover" is not one of the things that triggers clover protection, it left the clover in your inventory.

KoLmafia "re-disassembled the clover when your weren't looking" is not helpful. What else did you do?

Your statement that if the "policy" is that "all clovers should be disassembled when obtained" (which it is, since you have clover protection enabled), that "it doesn't work". Can you elaborate on how it "did not work"? It disassembled the clover when you "obtained" it - precisely as you asked it to do, since you have clover protection enabled.

I agree that if you are literally "acquiring" a ten-leaf clover, clover protection should presumably be disabled while that is happening in order to eliminate the extra step.
 
KoLmafia "re-disassembled the clover when your weren't looking" is not helpful. What else did you do?

I don't recall exactly, and apparently my saved logs don't keep as much information as the gCLI, but it looks like I didn't do anything else at all.

buy 1 ten-leaf clover for 1880 each from 1963563 on 20110518
You acquire an item: ten-leaf clover

Use 1 ten-leaf clover
You acquire an item: disassembled clover

Use 1 disassembled clover
You acquire an item: ten-leaf clover

Use 1 ten-leaf clover
You acquire an item: disassembled clover

I don't think there's anything I might have done in there that didn't get logged... (It's possible I typed "/use clover" in chat expecting my clover to be disassembled? I think that would have been logged, though...)

I'm fine with it being automatically disassembled and having to put it back together manually (as you point out, I did turn on clover protection), but having it disassembled automatically and put back together automatically is two database hits for no benefit whatsoever, isn't it?
 

Theraze

Active member
If you go adventure somewhere that doesn't have a clover adventure with an assembled clover and clover protection on, doesn't it re-disassemble to save you from accidentally losing the clover?

In other words, wasn't mafia doing exactly what you told it to do... run clover protection because clover protection was turned on?
 
If you go adventure somewhere that doesn't have a clover adventure with an assembled clover and clover protection on, doesn't it re-disassemble to save you from accidentally losing the clover?

Possibly, but I didn't adventure anywhere between getting the clover and realizing Mafia was fiddling with it.
 

Theraze

Active member
If you waited log enough, mafia would need to relog into KoL, forcing a new consideration of your inventory, including re-protecting your clover...
 

slyz

Developer
I had 19 disassembled clovers in my inventory and clover protection on. I tried to acquire 20 to reproduce this, so Mafia would by one from the mall. The result is... strange:
Code:
> acquire 20 ten-leaf

Verifying ingredients for ten-leaf clover (19)...
Creating ten-leaf clover (19)...
You acquire ten-leaf clover (19)
Successfully created ten-leaf clover (19)
[B]Searching for "ten-leaf clover"...
Search complete.
Searching for "disassembled clover"...
Search complete.
Verifying ingredients for ten-leaf clover (1)...
Verifying ingredients for disassembled clover (1)...
Creating disassembled clover (1)...
You acquire an item: disassembled clover
Successfully created disassembled clover (1)
Creating ten-leaf clover (1)...
You acquire an item: ten-leaf clover
Successfully created ten-leaf clover (1)[/B]
Using cached search results for ten-leaf clover...
Purchasing ten-leaf clover (1 @ 1,880)...
You acquire an item: ten-leaf clover
Using 20 ten-leaf clover...
You acquire disassembled clover (20)
Finished using 20 ten-leaf clover.
Purchases complete.
[COLOR="#ff0000"]You need 20 more ten-leaf clover to continue.[/COLOR]
 
Last edited:

Veracity

Developer
Staff member
As I said in my initial response: "if you are literally "acquiring" a ten-leaf clover, clover protection should presumably be disabled while that is happening".

If you find clovers, let clover protection kick in.
If you "buy" clovers, let clover protection kick in.
If you "acquire" them, you don't want disassembled clovers, you want the lucky ones, and it should not kick in.

That'll require a change to InventoryManager.retrieveItem, which is what does the work for "acquire".
 

slyz

Developer
I bolded the part of my CLI output that I found strange. It's due to the fact that ten-leaf clovers and disassembled clovers are one another's ingredient.

I can't look at the code right now, but aren't the wad of dough and flat dough handled in their own special function? Maybe clovers could use one like it?
 

holatuwol

Developer
I can't seem to get 'acquire' to buy a ten-leaf clover (it keeps buying a disassembled one instead), but I'm assuming the code changes do what they're supposed to do.
 

roippi

Developer
That's probably this block in retrieveItem:

Code:
		default:
			// Break creation loops - one item from every loop
			// (preferrably the cheapest one) must be indicated as
			// buyable, to avoid infinite recursion.
			scriptSaysBuy = itemId == ItemPool.DOUGH ||
				itemId == ItemPool.DISASSEMBLED_CLOVER ||
				itemId == ItemPool.JOLLY_BRACELET ||
				creator == null;
		}
 

roippi

Developer
Since it's been like half a year since "waiting for info" was set, I'm going to assume hola's r10516 addressed this issue. Reopen if not.
 
Top