Thread: Money bug fix
View Single Post
  #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