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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2008, 08:52 AM
kraeger
Fire Beetle
 
Join Date: Mar 2008
Location: Halas, Everfrost
Posts: 9
Default

I just got a message from someone who's line numbers aren't matching with mines for the fix, so I will put some surrounding code to make it easier.
(Oh and can someone tell me how to edit posts? )

The bug fix:

In client.cpp, on (or near) line 951:

Old code:
Code:
pp.beard		 = cc->beard;
pp.beardcolor	= cc->beardcolor;

pp.birthday		= bday;
pp.lastlogin	= bday;
New code:
Code:
pp.beard		= cc->beard;
pp.beardcolor	= cc->beardcolor;
//Temporary fix to missing hairstyle.
if (cc->hairstyle == 0)
{
	pp.eyecolor1	= 99;
}
pp.birthday		= bday;
pp.lastlogin	= bday;
In titanium.ccp, on (or near) line 470:

Old code:
Code:
//eq->unknown0140[4] = emu->unknown0140[4];
eq->is_npc = emu->is_npc;
eq->hairstyle = emu->hairstyle;
eq->beard = emu->beard;
//eq->unknown0147[4] = emu->unknown0147[4];
New code:
Code:
//eq->unknown0140[4] = emu->unknown0140[4];
eq->is_npc = emu->is_npc;
//Temporary fix to missing hairstyle.
if (emu->eyecolor1 == 99)
{
	eq->hairstyle = 0;
	eq->eyecolor1 = emu->eyecolor2;
}
else
{
	eq->hairstyle = emu->hairstyle;
}
eq->beard = emu->beard;
//eq->unknown0147[4] = emu->unknown0147[4];
In client_packet.cpp, on (or near) line 4390:

Old code:
Code:
m_pp.beard		= fc->beard;					

	
Save();
Message_StringID(13,FACE_ACCEPTED);
//Message(13, "Facial features updated.");
New code:
Code:
m_pp.beard		= fc->beard;					
//Temporary fix to missing hairstyle.
if (fc->hairstyle == 0)
{
	m_pp.eyecolor1	= 99;
}
	
Save();
Message_StringID(13,FACE_ACCEPTED);
//Message(13, "Facial features updated.");
Reply With Quote
  #2  
Old 08-04-2008, 09:09 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

You have five minutes to edit a post after it's made, then you can't. So making a new post is fine. This deserves a fresh bump anyhow, great fix =)

Looking forward to more of your work, this one has been frustrating for a very long time.
Reply With Quote
  #3  
Old 08-04-2008, 09:44 AM
leslamarch
Discordant
 
Join Date: Sep 2006
Location: Green Bay, WI
Posts: 436
Default

Excellent fix, Thanks very much.
Tested this and it all seems to be working perfect
Reply With Quote
  #4  
Old 08-04-2008, 01:01 PM
kraeger
Fire Beetle
 
Join Date: Mar 2008
Location: Halas, Everfrost
Posts: 9
Default

I improved the fix (If no bug is found, this will be the final version). It now looks better (in the code) and it fixes more visual problems. There was a missing hairstyle, but there was also a missing face, eyecolor, haircolor, beard and beardcolor.

Here is the new fix, please use this one instead of the one in the first post:
(I tested it for 10-20 minutes and it seems to works well, but please write in the thread if you still see any visual problems).

***New code is in blue***

In worlddb.cpp, on (or near) line 85:

New code:
Code:
cs->hair[char_num]				= pp->hairstyle;
cs->beard[char_num]				= pp->beard;

if (pp->face == 99)       {cs->face[char_num] = 0;}
if (pp->eyecolor1 == 99)  {cs->eyecolor1[char_num] = 0;}
if (pp->eyecolor2 == 99)  {cs->eyecolor2[char_num] = 0;}
if (pp->hairstyle == 99)  {cs->hair[char_num] = 0;}
if (pp->haircolor == 99)  {cs->haircolor[char_num] = 0;}
if (pp->beard == 99)      {cs->beard[char_num] = 0;}
if (pp->beardcolor == 99) {cs->beardcolor[char_num] = 0;}
				
// Character's equipped items
// @merth: Haven't done bracer01/bracer02 yet.
In client_packet.cpp, on (or near) line 4390:

New code:
Code:
	
        m_pp.beard		= fc->beard;

	if (fc->face == 0)       {m_pp.face = 99;}
	if (fc->eyecolor1 == 0)  {m_pp.eyecolor1 = 99;}
	if (fc->eyecolor2 == 0)  {m_pp.eyecolor2 = 99;}
	if (fc->hairstyle == 0)  {m_pp.hairstyle = 99;}
	if (fc->haircolor == 0)  {m_pp.haircolor = 99;}
	if (fc->beard == 0)      {m_pp.beard = 99;}
	if (fc->beardcolor == 0) {m_pp.beardcolor = 99;}

	
	Save();
	Message_StringID(13,FACE_ACCEPTED);
In Titanium.cpp, on (or near) line 511:

New code:
Code:
	
               eq->spawnId = emu->spawnId;
//		eq->unknown0344[4] = emu->unknown0344[4];
		eq->lfg = emu->lfg;

		if (emu->face == 99)	      {eq->face = 0;}
		if (emu->eyecolor1 == 99)  {eq->eyecolor1 = 0;}
		if (emu->eyecolor2 == 99)  {eq->eyecolor2 = 0;}
		if (emu->hairstyle == 99)  {eq->hairstyle = 0;}
		if (emu->haircolor == 99)  {eq->haircolor = 0;}
		if (emu->beard == 99)      {eq->beard = 0;}
		if (emu->beardcolor == 99) {eq->beardcolor = 0;}
      }
In client.cpp, on (or near) line 951:

New code:
Code:
 
       pp.beard		 	= cc->beard;
	pp.beardcolor	= cc->beardcolor;

	if (cc->face == 0)       {pp.face = 99;}
	if (cc->eyecolor1 == 0)  {pp.eyecolor1 = 99;}
	if (cc->eyecolor2 == 0)  {pp.eyecolor2 = 99;}
	if (cc->hairstyle == 0)  {pp.hairstyle = 99;}
	if (cc->haircolor == 0)  {pp.haircolor = 99;}
	if (cc->beard == 0)      {pp.beard = 99;}
	if (cc->beardcolor == 0) {pp.beardcolor = 99;}

	pp.birthday		= bday;
	pp.lastlogin	= bday;
Reply With Quote
  #5  
Old 08-04-2008, 01:23 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

I can't find anything referring to 'pp.beard' (or beard for that matter) in client.cpp.
What version source are you working with?
Reply With Quote
  #6  
Old 08-04-2008, 01:28 PM
leslamarch
Discordant
 
Join Date: Sep 2006
Location: Green Bay, WI
Posts: 436
Default

Quote:
Originally Posted by Angelox View Post
I can't find anything referring to 'pp.beard' (or beard for that matter) in client.cpp.
What version source are you working with?
Ax you need to grab the client.cpp from World not zone then your good to go
Reply With Quote
  #7  
Old 08-04-2008, 01:29 PM
kraeger
Fire Beetle
 
Join Date: Mar 2008
Location: Halas, Everfrost
Posts: 9
Default

I am working with 1118. I didn't know that, but there seem to be a client.cpp in "Zone" and in "World". You need to use the one in "World".
Reply With Quote
  #8  
Old 08-04-2008, 01:33 PM
kraeger
Fire Beetle
 
Join Date: Mar 2008
Location: Halas, Everfrost
Posts: 9
Default

Hahah, well two answers is better than none i guess
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:51 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