Bug - Fixed Purchases interface shows wrong info when I have not enough meat

If I am trying to buy anything through "Purchases" interface in Mafia, it adds "limit X" suffix to all offers that I cannot acquire. I.e. "carbonated soy milk (85 limit 85 @ 500)", "milk of magnesium (15,930 limit 15,930 @ 798)" and so on. Not harmful any way, but aesthetically wrong.
 
Here is purchase window, if I have meat enough for everything:

KoL - purchase1.png

And here is the same window, if I have not enough meat for something. Check bottom, grey part.

KoL - purchase2.png

Can you see the difference?
 

Veracity

Developer
Staff member
Yes. And I re-marked it to be a Bug.

Not one that I necessarily want to spend time looking at, but somebody else might want to. :)
 

Theraze

Active member
Looks like it's probably this part of the MallSearchRequest.java file:
Code:
				int limit = quantity;
				boolean canPurchase = true;

				Matcher limitMatcher = MallSearchRequest.LISTLIMIT_PATTERN.matcher( linkText );
				if ( limitMatcher.find() )
				{
					limit = StringUtilities.parseInt( limitMatcher.group( 1 ) );
					canPurchase = linkText.indexOf( "graybelow limited" ) == -1;
				}
As you can see, it sets the limit to the quantity and then changes that if it finds the limitMatcher later. Eh.
 

lostcalpolydude

Developer
Staff member
PurchaseRequest.toString() has
Code:
if ( this.limit < this.quantity || !this.canPurchase() )

Fixing this bug, if it really is one, is as simple as removing that last bit. I didn't change anything since I don't know why it was done to begin with.
 
Top