Bug retrieve_price is inconsistent (with Mayo items)

WARriorer

Member
Steps to reproduce:

Case: Do not have Mayo Clinic in workshed. Do not have Mayoflex in inventory. (Output inconsistent between retrieve_price and npc_price [and mall_price] for unacquirable items)
Code:
retrieve_price($item[Mayoflex]) // returns 9223372036854775807 (unacquirable)
npc_price($item[Mayoflex]) // returns 0 (unacquirable)

Case: Do not have Mayo Clinic in workshed. Have Mayoflex in inventory.
Code:
retrieve_price($item[Mayoflex]) // returns 0 (debugBuy indicates onhand=1, so an untradeable item has autosell=0)
npc_price($item[Mayoflex]) // returns 0 (unacquirable)

Case: Have Mayo Clinic in workshed. Do not have Mayoflex in inventory.
Code:
retrieve_price($item[Mayoflex]) // returns 9223372036854775807 (Unable to see npc_price of Mayo Clinic?)
npc_price($item[Mayoflex]) // returns 1000

Case: Have Mayo Clinic in workshed. Have Mayoflex in inventory.
Code:
retrieve_price($item[Mayoflex]) // returns 0
npc_price($item[Mayoflex]) // returns 1000

It's also a little inconsistent that retrieve_price returns 9223372036854775807 (effectively Infinity) for things that it thinks it can't acquire, but mall_price and npc_price returns 0 for things that they can't acquire (but at least this is deterministic so it's easy to handle once we know the behaviour).
 
It seems to me like this is reporting two issues:
- npc_price and retrieve_price have inconsistent behavior between one another for unobtainable items. This may ultimately be desirable!
- npc_price incorrectly assumes mayoflex is unpurchasable when the mayo clinic is active (in some cases? In all cases?)
 

WARriorer

Member
npc_price is correctly reporting 1000 when mayo clinic is active and 0 otherwise (no issues with npc_price, assuming 0 indicates impossibility [weird, but I guess there's no item purchaseable for 0 currency so that's fine]); it's retrieve_price that's incorrectly reporting the price
 

WARriorer

Member
I'm unable to test at this specific moment, but I believe yes - this surfaced for a few garbo users (where we set autoSatisfyWithNPCs to true, at the very start, before running the rest of the script), and while testing the cases above, retrieve_price() worked fine for items available in the general store (showing their npc prices and not their mall prices)
 
Top