Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-07-2010, 09:58 AM
Leere
Sarnak
 
Join Date: Sep 2008
Location: Home
Posts: 31
Default COMMITTED: Prices when buying stacks

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.)
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:46 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3