PDA

View Full Version : Armor Dye Issues from R174


trevius
11-13-2008, 05:07 AM
It appears that the armor dye fix in R174 was a little too good lol. Now it seems to be saving the slot color of whatever was worn first after the server was updated to a version with the Dye fix in it. So, if you were wearing purple armor, anything you put on now is purple no matter what color it is supposed to be.

I imagine that it is saving the colors in the player profile. But, I think it needs to know how to tie certain saved colors to certain pieces of equipment, instead of just to the slot in general, which is what it seems to be doing.

MNWatchdog
11-13-2008, 07:45 AM
Barnywear for everyone!

unknownhost
11-13-2008, 12:04 PM
on live i know it dyes by the slot. dye your chest slot black for example and it stays black regardless of item equiped (even no item equiped) until you dye again.

is this what ya mean its doin Trevius? or is it like perma dying even if you dye again it doesnt change colors?

trevius
11-14-2008, 05:25 AM
I think the problem is that it is dying the slot by the color of any item worn the first time logging in after the new code was put in for dyes, even if you didn't use dyes to get it that color. The color of the slot can be changed with dyes, but it shouldn't be setting the slot dye color until a dye is actually used.

EDIT: After looking at the diff, I think this is what is causing the problem:

zonedb.cpp
// Fix use_tint, previously it was set to 1 for a dyed slot, client wants it set to 0xFF
for(int i = 0; i<9; i++)
if(pp->item_tint[i].rgb.use_tint == 1)
pp->item_tint[i].rgb.use_tint = 0xFF;

If I was to guess, I think 1 might mean that it should use the color of the worn item and 0xFF means that the slot is dyed, so use that color. So, by just converting everything to 0xFF, it is overwriting the check to use any worn item's set color and just using the color of the items that were set when the slots were changed to 0xFF as a permanent new dyed color for that slot. I think the solution for this would be to change it so that only dying items will set it to 0xFF. And, by using the reset button in the dye window, it should change it back to 1 again so item color is used again until another dye is used. At least the code is very close to having this fixed perfectly I think. Just need to remove that section posted above and do the conversion when a dye is applied instead. And then figure out how to use the reset button.

Derision
11-16-2008, 07:33 AM
The main problem was that the original code would dye the slot to the color of whatever item you put in it, which was wrong.

I've put in a #undyeme command which resets all slots to undyed, so after using that command, everything should then behave correctly relating to dying.