Bug - Fixed 'acquire print screen button' fails if the coinmaster is sold out

Rinn

Developer
This isn't a huge deal as I can call buy() manually but I would have expected acquire to attempt to buy from the mall if _internetPrintScreenButtonBought is true.

> acquire print screen button

Verifying ingredients for print screen button (1)...
Purchasing print screen button (1 @ 111 BACON)...
Visiting the Internet Meme Shop...
Internet Meme Shop successfully looted!
Creation failed, no results detected.

> ashq buy(1, $item[print screen button])

Searching for "print screen button"...
Search complete.
Purchasing print screen button (1 @ 34,999)...
Purchases complete.
 
Do you actually allow mafia to buy from the mall automatically and does the print screen button fall within the autobuy price limit?
 
Last edited:

fronobulax

Developer
Staff member
Did you confirm it actually failed by refreshing inventory and manually inspecting? There are a couple of 'creation failed" messages that are actually bogus, IIRC.
 

lostcalpolydude

Developer
Staff member
I confirmed this bug. It doesn't show as buyable in the Coinmaster window because mafia knows to exclude it, but mafia tries to use the coinmaster to acquire it for the CLI command anyway.
 

Darzil

Developer
I think this may be as simple as adding a check that item is buyable in CoinMasterPurchaseRequest.java:

Code:
	@Override
	public boolean canPurchase()
	{
		return this.canPurchase && this.data.isAccessible() &&
			[b]this.data.canBuyItem( this.item.getItemId() ) &&[/b] this.affordableCount() > 0;
	}

Will have to wait for aftercore to test, though.
 

taltamir

Member
IIRC the acquire command only buys item from the mall if they cost under ~20k meat (a guesstimate based on observed behavior) to prevent accidents. I have seen this behavior on many different items.
 

lostcalpolydude

Developer
Staff member
It is not autoBuyPriceLimit. That has nothing to do with mafia trying to buy it from the NPC shop (visible in the copy-pasted output in the first post).
 

fronobulax

Developer
Staff member
It is not autoBuyPriceLimit. That has nothing to do with mafia trying to buy it from the NPC shop (visible in the copy-pasted output in the first post).

> acquire print screen button

Verifying ingredients for print screen button (1)...
Purchasing print screen button (1 @ 111 BACON)...
Visiting the Internet Meme Shop...
Internet Meme Shop successfully looted!
Creation failed, no results detected.

> ashq buy(1, $item[print screen button])

Searching for "print screen button"...
Search complete.
Purchasing print screen button (1 @ 34,999)...
Purchases complete.

Since acquire was being used, the behavior I expect is that it will iterate over the acquisition methods in order from lowest to highest cost until the item is acquired. I interpreted the output as saying it first tried the NPC store and failed because it was "out of stock". It then tried the mall and failed, presumably because autoBuyPriceLimit was less than 34,999.

Is my expectations of how acquire works incorrect or could the buy limit be a factor after the NPC purchase is unsuccessful?
 

lostcalpolydude

Developer
Staff member
Creation failed, no results detected.
That results in an error state. The bug is that mafia uses a server hit trying to buy from the coinmaster (when it should know that it can't), and then the failure means the mall purchase is never attempted.
 

fronobulax

Developer
Staff member
That results in an error state. The bug is that mafia uses a server hit trying to buy from the coinmaster (when it should know that it can't), and then the failure means the mall purchase is never attempted.

Thank you. Then this is a bug or FR because acquire does not continue after the first failure? Apologies if that was obvious to everyone else, but I just figured it out.
 

heeheehee

Developer
Staff member
Well, not quite. I'd argue that the bug is that acquire doesn't respect the pref (and tries to acquire from the coinmaster in the first place).

Might just need an entry in CoinMastersDatabase.availableItem() and possibly also purchaseLimit().
 

Darzil

Developer
I think it is that somewhere, it checks if the item exists in the coinmaster database (it does) rather than that it is purchasable (it isn't).
 

heeheehee

Developer
Staff member
Ah, it's in MemeShopRequest.canBuyItem(), which only seems to be checked (in this particular execution) in CoinMasterRequest.buy().

Good news, I guess, is that it doesn't invoke an unnecessary server hit as is.
 
Top