Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2003, 06:33 AM
Yodason
Hill Giant
 
Join Date: Jan 2002
Posts: 205
Default Money bug fix

Code:
void Client::AddMoneyToPP(uint32 copper,bool updateclient){

	uint32 tmp;

	uint32 tmp2;

	tmp = copper;

	tmp2 = tmp/1000;

	pp.platinum = pp.platinum + tmp2;

	tmp-=tmp2*1000;

	if (updateclient)

		SendClientMoneyUpdate(3,tmp2);

	

	tmp2 = tmp/100;
	
	tmp-=tmp2*100;

	pp.gold = pp.gold + tmp2;

	if (updateclient)

		SendClientMoneyUpdate(2,tmp2);

	

	tmp2 = tmp/10;

	tmp-=tmp2*10;

	pp.silver = pp.silver + tmp2;

	if (updateclient)

		SendClientMoneyUpdate(1,tmp2);



	if (updateclient)

		SendClientMoneyUpdate(0,tmp);

	pp.copper = pp.copper + tmp;

	Save();

	LogFile->write(EQEMuLog::Debug, "Client::AddMoneyToPP() %s should have:  plat:%i gold:%i silver:%i copper:%i", GetName(), pp.platinum, pp.gold, pp.silver, pp.copper);

}
Reply With Quote
  #2  
Old 06-11-2003, 06:50 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

What was the original bug Yoda? Miscalculation of money?
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #3  
Old 06-11-2003, 07:09 AM
fnemo's Avatar
fnemo
Discordant
 
Join Date: Dec 2002
Posts: 354
Default

merchant robering the client ... i think .
__________________
Nemo
Administrator and coder for the World Alkora Server
Reply With Quote
  #4  
Old 06-11-2003, 08:59 AM
gej302
Sarnak
 
Join Date: May 2003
Location: Silverfist
Posts: 42
Default

I think it's the bug where your money gets recreated on all the sub levels when you zone after selling something. May not always happen, but you would at least occasionally end up with 293p 293xg 293xxs 293xxxc if you sold about 293p worth of gear as I recall, might have also happened when you altered your money denomination but didn't bank it... I can't recall exactly
Reply With Quote
  #5  
Old 06-11-2003, 10:15 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Ah, when converting, the converted amount was never deducted from the original amount...

101 copper should be 101/1000 = 0 by integer division, then 101/100 = 1, so 1 gold, so new amount is now 101-100 = 1 remainder, 1 /10 = 0 silver, then +1 copper, so 101 copper = 1 gold 1 copper.

Good catch on that Yoda. Just merged the fix in.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
Reply


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 11:06 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