Code:
zone\client_packet.cpp (rev 1276)
@@ -4936,11 +4936,13 @@
}
}
+ int singleprice = 0;
if (RuleB(Merchant, UsePriceMod)){
- mpo->price = (item->Price*(RuleR(Merchant, SellCostMod))*item->SellRate*Client::CalcPriceMod(tmp,false))*mp->quantity;
+ singleprice = (item->Price*(RuleR(Merchant, SellCostMod))*item->SellRate*Client::CalcPriceMod(tmp,false));
}
else
- mpo->price = (item->Price*(RuleR(Merchant, SellCostMod))*item->SellRate)*mp->quantity;
+ singleprice = (item->Price*(RuleR(Merchant, SellCostMod))*item->SellRate);
+ mpo->price = singleprice*mp->quantity;
if(freeslotid == SLOT_INVALID || (mpo->price < 0 ) || !TakeMoneyFromPP(mpo->price))
{
safe_delete(outapp);
@@ -4976,7 +4978,7 @@
else {
// Update the charges/quantity in the merchant window
inst->SetCharges(new_charges);
- inst->SetPrice(mpo->price);
+ inst->SetPrice(singleprice);
inst->SetMerchantSlot(mp->itemslot);
inst->SetMerchantCount(new_charges);
This addresses two issues. The first is how the client displays the wrong price for items from the temporary item list when not all of them were bought within one transaction. PEQ
(link) has two reports of that issue.
The second issue is more of a side benefit of the first fix, it fixes the part where buying a stack of items leads to a price that is not equal to the displayed price times the quantity. (For example, buying a flask of water. Displayed price of 1 silver. Buying a stack of 20 them then leads to a price of 2g 3c, instead of the expected 2g.)