Fix for bald players bug
Hey. I've been working on the bald players problem for 2-3 days now. For those who don't know about the problem, one of the hairstyle for every race/gender combo doesn't show as it should on luclin models and we see a bald player instead of the selected hairstyle.
Here is what I found: -There are two groups of race/gender combos that are affected by this problem. The race/genders that have 3 hairstyle selections and the race/genders that have 4 hairstyle selections. ex:Human/Female: You can choose from 3 different hairstyles. (Values 0 or 1 or 2) Human/Male: You can choose from 4 different hairstyles. (Values 255 or 0 or 1 or 2) *Hairstyle 255 is the bald player model that you can choose on the character creation menu, only available for male characters and troll/ogre female characters. -The problem we want to solve always happen with hairstyle "0". -Instead of getting the value "0" when this is what the user pick on character creation, it somehow end up with the value "255". This is why we see a bald character when choosing hairstyle "0", it actually show hairstyle "255". Note: -The hairstyle 0 is correctly shown on the character selection screen. -The hairstyle 0 is correctly shown after using /facepick, but after zoning or dying the bald player problem comes back. -After selecting hairstyle 0 on character creation menu, the value "0" seems to be stored correctly in pp.hairstyle, but somehow gets lost along the way and is modified to "255". -Could it be because we transfer a value between int, int8, uint8 and int32 variables? Anyway, here is a way to fix the bug: In client.cpp, on line 951, add: Code:
//Temporary fix for missing hairstyle. Code:
//Temporary fix for missing hairstyle. Code:
//Temporary fix for missing hairstyle. *Important: For the fix to work on an old character (if it's affected by the the bug), you have to do a /facepick in game to have it's hairstyle fixed. This only need to be done once. *Any existing character can pick the new hair style with /facepick. *New characters automatically have the bug fixed. *The fix does not affect people who don't use luclin graphic since pre-luclin only uses the variable "face" and is not using the variable "hairstyle". *If this ends up in the EqEmu code, I could also fix other appearance bugs, using different flag values in eyecolor1, that would only add 2-3 lines to the previous code. **(An other appearance bug, for example, is when we select the haircolor 0 (ex.: dark brown for human male), we end up with haircolor 255 (ex.: white for human male)). The best would be to find why the hairstyle value gets switched from "0" to "255". I really start to think it's an int, int8, int32, uint8 problem, but to be honest, I'm not very good with structs and pointers, so after many hours I was not able to find it. But meanwhile (or if no one feels like working on that), this fix solves the problem. |
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? :rolleyes: ) The bug fix: In client.cpp, on (or near) line 951: Old code: Code:
pp.beard = cc->beard; Code:
pp.beard = cc->beard; Old code: Code:
//eq->unknown0140[4] = emu->unknown0140[4]; Code:
//eq->unknown0140[4] = emu->unknown0140[4]; Old code: Code:
m_pp.beard = fc->beard; Code:
m_pp.beard = fc->beard; |
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. |
Excellent fix, Thanks very much.
Tested this and it all seems to be working perfect :D |
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; New code: Code:
New code: Code:
New code: Code:
|
I can't find anything referring to 'pp.beard' (or beard for that matter) in client.cpp.
What version source are you working with? |
Quote:
|
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".
|
Hahah, well two answers is better than none i guess :wink:
|
Ok, I got ya now, I should have searched better.
Thanks for the code BtW :) |
Seems all the NPCs have white hair now. Is that a result of fixing all the different 0 values? I think we were seeing brown hair as the default on NPCs previously because that's what 0 was getting twisted into. Seems that 0 is actually white hair.
Is that the way you understand it to work? |
Quote:
|
Angelox is right, it's not my fix that is in the code. I was quite happy to see that a better code had been written, but i will be honest, i am a bit sad after seeing that my name is not in the changelog, at least as part of the team that helped solve the problem, i spent 25+ hours working on this bug..
Anyway: haircolor 255 = white hairs (when working correctly) haircolor 0 = dark brown hairs (when working correctly) I haven't tried 1120 and i don't know what the new fix is in the code, but this what i can understand from what So_1337 is seeing in game: My fix only affected player characters, this is why we didn't see a change on NPC. From what i understand, the new fix is working on both player and NPC, so we would either need to know what kind of characters it's drawing (Player or NPC) or we would need to update the default NPC model to have brown hair (after the fix). |
I had no idea, my apologies. I saw your fix here and the reports that it was working, then saw that 1120 included a fix for bald players and assumed it to be yours.
Guess we'll have to wait for the full story from KLS. Thanks for the information, guys. |
Yeah I'm sorry, but none of your code was used for the fix, I'm not even sure if it's a full fix atm. But you were the inspiration behind it, I'll add you to the log on next update if you'd like.
|
None of my code was used so i don't deserve any credit? Well that is kind of rude.
A problem is around for 2-3 years. I find the bug. I write a code that 100% fix it. People test it and it's working. No more bug. Two days later, a dev comes around and rewrite my code, fixing the same bug but in a different way. (Using all the info i gathered (i said exactly what was not working), taking notes on how i fixed the bug but not using my code, he write his own code.) The dev code ends up in 1120: -Breaking all npcs hair colors, they all have white hairs now (my code solved that problem) -You can't pick the dark brown hair color, it turns white (my code solved that problem) -You can't pick one beard model, one face model and one eyecolor (my code solved that problem) Then, he tells me that i don't deserve any credit for "fixing this bug", since none of my code was used. He also tell me that all i was is the inspiration that helped him make his new amazing improved piece of code. Finally, he says that i can have my name written in the next changelog if that can make me happy.. so i shup up and stop talking about it. If anyone want to say that this is drama, that i am overreacting, that i'm just crying, go ahead.. this is what i'm doing. But right after you post, please re-read what i wrote and ask yourself if i have any reason to feel that way. Can i remind that dev that right now, i am the only one who made a working fix for this problem.. and i don't deserve any credit? Is this how things work here? *Btw, don't add my name to the changelog. I won't be posting on this forum anymore, don't worry. |
Part of the changelog is to give credit to whoever's code goes into the source and another part is probably to help keep track of what was done by who for tracking purposes.
It sounds like your fix might have worked just as good or better than what went into the 1120 source (I haven't tested it yet). But, I am also very sure that KLS didn't use your source changes for a reason. She is a very skilled coder and she makes sure that anything that goes into the source is as complete as possible. It is very rare that something that is incomplete makes it into the source (I am not saying your fix was incomplete). If she thought it was necessary to rewrite everything you had already done from scratch, then I am sure she had a good reason. Though, I do think that your name deserves to at least be mentioned in the change log since you did a lot of the foot work for it as well as being the first person to even attempt to fix it after all of this time that the bug has been submitted. Please keep in mind that while you are the one that made the original fix, that it apparently isn't at all the same as what went into the code. So, technically there is nothing wrong with your name not being in there. I am sure KLS only left your name out because the actual code was her own, so for tracking purposes your name shouldn't be there accept possibly noted as inspiration for the real code. I do see that your name was put in there for the Random Name Generator Fix. So, it isn't like the team is trying to take credit for other people's fixes. There is a lot going on with this project and everyone works on it in their own free time for free. Occasionally some code won't get the right credit in the change log (which is fairly rare), and sometimes code even gets forgotten and never makes it in when it really should have. I have been trying to help keep things organized so that we don't lose any good fixes. But, again there is a lot going on and it is hard for some people to keep up with every little thing that gets posted on these forums. I have more free time for it than most do, and that is why I try to do what I can. What I am trying to say is that I don't want you to get the wrong impression about how this project and team works. We all have real lives to deal with and all have busy schedules. Mistakes will be made due to limited resources. The team would never intentionally take credit for someone else's work. KLS has never been anything but nice and helpful to this project and everyone involved. I think you are just having a misunderstanding of the situation and so I hope that I have cleared some of it up. The entire community is thankful to anyone who spends time fixing bugs and adding new additions for the source. I personally appreciate the work you have done so far quite a bit. And, I honestly hope you will reconsider your view on the project and on these forums. This project is about the community though. So, if you are just posting code fixes to get your name in the change log, then you are posting them for the wrong reasons, IMO. I do what I do just to help people. And, by doing so, I have a fairly good reputation. I wish the project could be slightly more organized and give everyone credits and rewards for everything they help out with, but this site does receive a considerable amount of traffic. Though, if you are able to be a consistent positive member of the community, you will certain be able to make a name for yourself if that is what you want. Thanks again for your code fixes. I hope you reconsider continuing to post them here. |
Well I couldn't really see fit to defend myself without sounding like a jerk so thank you Trev.
Over-reacting just a bit I think. Anyway I'm going to be undoing my fix anyway as it was only experimental. I'm going to review the code you posted to get a better idea of what is wrong. That said the reason your code isn't going in as is is because it's a workaround which I try to avoid whenever possible; ie it's better to fix the issue than bandaid it. If it's fixed via what's I just said you will get credit as a derived work. I wasn't trying to hurt your feelings, I promise. |
I had a long post typed up, but I honestly feel I'm in over my head here. I don't know the code well enough to speak on it.
To put it simply, though, the ends are just as important as the means when it comes to fixes around here. You solved the problem and gave Kim a great idea of how to fix it herself without the need for a work-around. I'm sure if she wasn't so strapped for time, she would've communicated it better, as she's never been anything but courteous and respectful. We're lucky to see as much work from her as we do, I reckon =) Take a deep breath, and relax. This is a group project, and it sure isn't over. Plenty of time to get everything ironed out, be it proper credit in the changelog or a fix that not only solves the problem, but does it in a way consistent with the rest of the code. Would really love to see you continue your work here. |
I saw this one coming right after I diff'd the update -
Put kraegers fix in, then, when you make a better fix, take his out, put yours in! Meantime, people get a bald players fix, kraeger gets his earned recognition, and everyone is happy. Regardless of what you think, people need recognition for their work - you all have your titles and colored names, and that's recognition for your work! |
The only problem I see with that idea is that if a work-around gets put into the source, there is a high chance that it will become the permanent solution as many don't take the time to go back and do it the right way if it already mostly works correctly. Then you wind up with source code full of work-arounds instead of permanent real fixes. It isn't the worst thing in the world, but it probably makes for somewhat sloppy code that is hard to make sense from when others decide to write more code for it.
It took quite a while before this issue was even looked into. So, if it had a work around, I doubt it will ever be looked into again. It is only a cosmetic issue after-all, so it isn't like it is top priority to get perfect code in for it. Not that we appreciate the cosmetic fixes less than any other type, but they probably aren't the top of most coder's mind when considering what to fix next. I fully agree that people need credit for their work. But, in this case, I think it is a misunderstanding at best. KLS wrote the code that went into the source, so really Kraeger's name shouldn't be on her code. But, like I said, he definitely should at least get credit for the work he did on getting the issue brought to the table and a good work around to fix it. Even if the note in the change log was something like "(Thanks for Kraeger's work on getting this fix started)" or maybe even (KLS and Kraeger) for some generic credit. IMO, I am sure that most people who would care about who added to code already are well aware that Kraeger started the work to get this issue resolved and that he has some nice code to resolve it. I have had one of my code adjustments (even though it was minor) added to the source without even a note about it being added lol. I didn't really care about getting my name in there, but I did make a comment to ask that a note get added for it just so people were aware that it went in. I am proud to have a pink name for the help I do around here. But, even if I didn't I would still help out just as much. I realize that things sometimes move a little slow around here. I also realize that everything the team does, they do with the best intentions. So, if something gets missed, I know better than to get upset about it. It wasn't intentional. I just stay patient and discuss it or send reminders if needed. |
Quote:
|
Code:
--Bald players bug fixed. KLS I am very new to this project and I know exactly who you are, as everyone else does. You don't need any more recognition then the load of it that you already have. Everyone knows who you are and the fact is this never would have been done without Kraeger (at least not anytime soon.) So I think the patch notes I put at the top of this post will make everyone happy. I would have reacted the same way as Kraeger, but the fact is not too many people read the patch notes. The only people that actually read the patch notes (for the most part) read the forums as well and know what the situation is and know who did what. So with that said, can you just do what I suggested to make everyone happy and then forget about this issue. KLS you may not understand, but people who are unknown (ironic I know) and have no reputation make these code fixes for the appreciation and recognition more than to fix the problem for the most part. I don't know Kraeger, maybe he's helped before. But my point is that when someone spends their time fixing something and then sees it completely re-written with different credit given it's a horrible feeling in the gut. I know because I've written several plugins for MQ2 that were stolen by other people and sold as their own, and that just leaves a wrenched feeling in my stomach. |
Quote:
Code:
KLS: Fix for bald characters hopefully (inspired by code from Kraeger). Quote:
Quote:
I have written some code (based on other code submissions) to allow admins to disable Call of the Hero on a Per Zone Basis. If someone completely rewrote the code so that it worked on a perimeter to disable spells, does that mean I should get any credit for it? Not in my opinion. Sure, maybe I posted code to get it to work one way, but if someone rewrote it, and that new code was put into the source, I wouldn't expect my name to be on it, nor care if it was. Quote:
Quote:
Quote:
We keep a close eye for any types of wrong doing in these forums. If someone was being wronged, it would be openly discussed (as this is) and whatever it takes to make it right again would be done. For the record, Kraeger has helped before with his Random Name Generator fix. The entire community is very appreciative of any fixes that come in. I know one of my favorite things about coming here is when I see new server code submissions and get to see what has been fixed! I think this situation is border-line. No harm or offense was meant in what was done. And, I see nothing blatantly wrong with what KLS did. I do think Kraeger over-reacted a little. And I also think that KLS probably could have added his name in there somehow to avoid this, but I don't blame her for anything. She is a coder after-all, not a customer service representative! I am sure that she wasn't intentionally trying to short-change Kraeger even if he saw it that way. I wouldn't be surprised if she has already changed the note right after this issue was first brought up. It takes a couple of days sometimes for Sourceforge to update that information. For someone new to this project, I would suggest to please have some patience and keep following the project. This obviously isn't going to give the best impression to someone who just started recently. But I promise that if you keep following these forums you will learn to respect and trust the team. Given that we all have busy lives and things of our own to deal with, I think the team and community here is impeccable. You would have to dig seriously deep in these forums to find issues with the team or the project. And even then, I have never found one that looked anything like there was corruption or greed of any sort. I have probably read more of these forums than 99% of the people here (including very old posts and archives), and I still say that it is a very honest and mature community, team and project minus a very few exceptions here and there. |
I didn't read the last two paragraphs but yah when I said for the most part people who are unknown make fixes for recognition I am not lying. Take credit away from ANYONE who is not very well known and posting code and see how they react. They like the credit, they want the credit, they wouldn't care as much without the credit.
PS: About the whole I don't know KLS, I do know KLS. I meant I don't actually know her, I've never read one post made by her but I know what she does and I always see her name around the emulator forums on patch notes or just mention of the name. Sorry I know that sounded really bad, I don't know her at all then next paragraph I know exactly who you are ;) |
Basic rule of thumb: if the code goes in to source in any form there will be credit given, otherwise there wont.
To be honest I don't think "inspiration" is a good precedent to be setting; I've never credited it before and I doubt I'll ever credit it again except in special circumstances like this one. I will be doing it for this change, just because I agree that it probably wouldn't of happened without him. Change will be going in tonight we'll see if it works better, I haven't run into any issues with it but I can only check so many race/gender/hair combos. |
Alright, finally got a chance to put 1123 in and check it out.
Hair styles are staying for PCs. Hair color, though, is not (that I can tell). Testing with a female human. Trying for this hair style: http://www.cfc-solar.com/uploads/Tissi.jpg Even after correcting it with /face and relogging, it shows up white each time. Seems that the problem was fixed for NPCs, however, as they show with the hair color they should have. Good work thus far =) |
All times are GMT -4. The time now is 03:24 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.