Bug - Fixed Mayo property tracking

Ezandora

Member
r16613
Acquiring mayo condiments affects _mayoDeviceRented and _mayoTankSoaked tracking:
Code:
> prefref _mayo

_mayoDeviceRented(user, now 'false', default false)
_mayoTankSoaked(user, now 'false', default false)

> acquire mayoflex

Purchasing Mayoflex (1 @ 950)...
You spent 950 Meat
You acquire an item: Mayoflex
Purchases complete.

> prefref _mayo

_mayoDeviceRented(user, now 'true', default false)
_mayoTankSoaked(user, now 'true', default false)

> ashq visit_url("campground.php?action=workshed");

> prefref _mayo

_mayoDeviceRented(user, now 'false', default false)
_mayoTankSoaked(user, now 'false', default false)

I believe this is caused by parseShopResponse in NPCPurchaseRequest.java. It will automatically try to set these preferences from the shop text, but "acquire mayoflex" is an ajax request, ("shop.php?whichshop=mayoclinic&action=buyitem&whichrow=720&ajax=1&quantity=1") which omits the store text.

The mayoclinic parsing code should be moved to after this line, which occurs later in the method:
Code:
if ( urlString.contains( "ajax=1" ) )
{
	return;
}

Or, alternatively change the code to:
Code:
boolean response_contains_shop_text = !urlString.contains( "ajax=1" );
And have each shop individually test against this, when relevant. (mayoclinic, bartlebys, and hippy)
This should make the code more explicit:
Code:
if ( shopId.equals( "mayoclinic" ) && response_contains_shop_text )


As a separate issue, successfully using the mayo lance in combat should reduce mayoLevel by thirty, to a minimum of zero. At the moment, it is unaffected.
 

lostcalpolydude

Developer
Staff member
Both of those fixed in 16614. Most shop parsing happens in other classes, so I didn't bother with an ajax variable.
 
Top