Well, when we submit a MallSearchRequest, the processResults method calls searchMall. That looks at every item returned in the result and pulls out the itemId.
However, that is not the method that updates the historical price. I see the following in the run() method:
Code:
// If an exact match, we can think about updating mall_price().
if ( this.searchString != null && this.searchString.startsWith( "\"" ) )
{
String name = this.getFormField( "pudnuggler" );
StoreManager.maybeUpdateMallPrice( AdventureResult.pseudoItem( name ), new ArrayList<PurchaseRequest>( results ) );
}
Notice that it passes in an ArrayList of the results it got back - which are PurchaseRequests, which include the itemId.
It looks like StoreManager.maybeUpdateMallPrice is passed AdventureResult item - but the only thing it cares about is item.getItemId(). It also seems like it could get the itemId from the first PurchaseRequest it is given.
Or, perhaps, MallSearchRequest could do something like this:
Code:
if ( this.searchString != null && this.results.size() > 0 && this.searchString.startsWith( "\"" ) )
{
AdventureResult item = this.results.get(0).getItem();
StoreManager.maybeUpdateMallPrice( item, new ArrayList<PurchaseRequest>( this.results ) );
}
instead of what I cited above.