Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bug Reports

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 06-04-2006, 12:37 PM
WildcardX
Developer
 
Join Date: Apr 2003
Posts: 589
Default

I have corrected this bug. The bug was when a quest gives a player a cash reward, the player doesn't see something like "1 gold, 2 silver, 3 copper". Instead the output they recieve is something like "<null char> gold, <null char> silver, <null char> copper".

Please change the following method:

void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
moneyOnCorpseStruct* d = (moneyOnCorpseStruct*) outapp->pBuffer;
d->response = 1;
d->unknown1 = 0x5a;
d->unknown2 = 0x40;
d->unknown3 = 0;
if (initiator && initiator->IsClient())
{
d->copper = copper;
d->silver = silver;
d->gold = gold;
d->platinum = platinum;
initiator->AddMoneyToPP(d->copper, d->silver, d->gold, d->platinum,true);
initiator->QueuePacket(outapp);
string tmp;
if (d->platinum>0){
tmp = "You receive ";
tmp += d->platinum;
tmp += " plat";
}
if (d->gold>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += d->gold;
tmp += " gold";
}
else{
tmp += ",";
tmp += d->gold;
tmp += " gold";
}
}
if(d->silver>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += d->silver;
tmp += " silver";
}
else{
tmp += ",";
tmp += d->silver;
tmp += " silver";
}
}
if(d->copper>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += d->copper;
tmp += " copper";
}
else{
tmp += ",";
tmp += d->copper;
tmp += " copper";
}
}
tmp += " pieces.";
if (initiator)
initiator->Message(MT_OOC,tmp.c_str());
}
safe_delete(outapp);
}

To the following method:

void QuestManager::givecash(int copper, int silver, int gold, int platinum) {
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
moneyOnCorpseStruct* d = (moneyOnCorpseStruct*) outapp->pBuffer;
d->response = 1;
d->unknown1 = 0x5a;
d->unknown2 = 0x40;
d->unknown3 = 0;
if (initiator && initiator->IsClient())
{
d->copper = copper;
d->silver = silver;
d->gold = gold;
d->platinum = platinum;
initiator->AddMoneyToPP(d->copper, d->silver, d->gold, d->platinum,true);
initiator->QueuePacket(outapp);
string tmp;
if (d->platinum>0){
tmp = "You receive ";
tmp += itoa(d->platinum);
tmp += " plat";
}
if (d->gold>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += itoa(d->gold);
tmp += " gold";
}
else{
tmp += ",";
tmp += itoa(d->gold);
tmp += " gold";
}
}
if(d->silver>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += itoa(d->silver);
tmp += " silver";
}
else{
tmp += ",";
tmp += itoa(d->silver);
tmp += " silver";
}
}
if(d->copper>0){
if (tmp.length()==0){
tmp = "You receive ";
tmp += itoa(d->copper);
tmp += " copper";
}
else{
tmp += ",";
tmp += itoa(d->copper);
tmp += " copper";
}
}
tmp += " pieces.";
if (initiator)
initiator->Message(MT_OOC,tmp.c_str());
}
safe_delete(outapp);
}

This will allow the correct output to be sent to the player. Easy fix and not earth shattering. All I did was convert to uint32 datatype to a char that is then appened to the string object. This method is from the questmgr.cpp file.

Last edited by WildcardX; 06-04-2006 at 08:46 PM..
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 05:24 AM.


 

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