Bug - Fixed retrieve_item appears to be searching the mall multiple times per ingredient

Rinn

Developer
All these mall searches are from a single call to retrieve_item for a single entendre:
Code:
Searching for "bottle of tequila"...
Search complete.
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Searching for "double entendre"...
Search complete.
Searching for "bottle of tequila"...
Search complete.
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Searching for "bottle of anís"...
Search complete.
Searching for "single entendre"...
Search complete.
Searching for "double entendre"...
Search complete.
Searching for "bottle of tequila"...
Search complete.
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Searching for "bottle of anís"...
Search complete.
Searching for "lemon"...
Search complete.
Using cached search results for bottle of tequila...
Using cached search results for fermenting powder...
Using cached search results for cactus fruit...
Searching for "double entendre"...
Search complete.
Searching for "bottle of tequila"...
Search complete.
You are now in away mode, chat will update more slowly until you say something.<br></br>
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Searching for "bottle of anís"...
Search complete.
Searching for "double entendre"...
Search complete.
Searching for "bottle of tequila"...
Search complete.
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Searching for "bottle of anís"...
Search complete.
Searching for "lemon"...
Search complete.
Verifying ingredients for single entendre (1)...
Using cached search results for bottle of tequila...
Using cached search results for fermenting powder...
Using cached search results for cactus fruit...
Searching for "bottle of tequila"...
Search complete.
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Searching for "bottle of anís"...
Search complete.
Searching for "bottle of tequila"...
Search complete.
Searching for "fermenting powder"...
Search complete.
Searching for "cactus fruit"...
Search complete.
Using cached search results for bottle of tequila...
Using cached search results for fermenting powder...
Using cached search results for cactus fruit...
Searching for "bottle of anís"...
Search complete.
Verifying ingredients for double entendre (1)...
Using cached search results for fermenting powder...
Using cached search results for cactus fruit...
Using cached search results for fermenting powder...
Using cached search results for cactus fruit...
Verifying ingredients for bottle of tequila (1)...
Purchasing fermenting powder (1 @ 63)...
You spent 63 Meat
You acquire an item: fermenting powder
Purchases complete.
Using cached search results for cactus fruit...
Purchasing cactus fruit (1 @ 490) from #688802...
Purchases complete.
Creating bottle of tequila (1)...
You acquire bottle of tequila (3)
Successfully created bottle of tequila (3)
Searching for "bottle of anís"...
Search complete.
Purchasing bottle of anís (1 @ 29,392) from #1395814...
Purchases complete.
Creating double entendre (1)...
You acquire an item: double entendre
Successfully created double entendre (1)
Purchasing lemon (1 @ 63)...
You spent 63 Meat
You acquire an item: lemon
Purchases complete.
Creating single entendre (1)...
You acquire an item: single entendre
Successfully created single entendre (1)
 
I had what may have been a similar issue over Crimbo a few times when attempting to acquire and eat a moosemeat pie through the maximizer, where it would just sort of loop through searching for the various ingredient steps. I do not know if it would have eventually finished as it appears to have done in your case, as I force ended execution and just made the pie myself after the third or so time it happened. Also of note is that at least once, after using esc to end automation while it was doing this, mafia would automatically go right back to it if I told it to do anything else, as though it had only paused.

I can try and find the relevant log sections if anyone feels they would be helpful for this.
 

Rinn

Developer
I believe I tracked this down to InventoryManager.priceToAcquire(), specifically this line, if exact is true then 0.0f is passed in to StoreManager.getMallPrice() as the age and that causes the session mall cache to get flushed every call.

My thought is that for exactt requests this should either
  1. pass in a small non-zero value (like 0.003472 for ~5min maybe) -or-
  2. call the version of getMallPrice() that doesn't accept maxAge so it always uses the cached value from the current session
@Veracity thoughts?
 
Last edited:

Rinn

Developer
I did the second because that seems more in line with how mall searches generally work everywhere else, and I couldn't find any other instances where 0 was hardcoded being passed into getMallPrice().

 
Top