Log in

View Full Version : New NPC color tint bug


ChaosSlayerZ
05-24-2009, 11:08 PM
guys the new npc color tint is just a little bit screwed up - the RED collumn is in fact gives BLUE color, and vice-verse :D

Shendare
05-25-2009, 02:54 AM
Hey, you're right!

I think I fixed this in my pre-release testing, but managed to un-fix it before posting it on the forums.

That's what I get for working on personal stuff at work as well as home. :D Multiple versions of code.

The Fix (hopefully Trev or someone can source it into the SVN pretty quickly):

zonedb.cpp - Line 1268


...
tmpNPCType->drakkin_details = atoi(row[r++]);
tmpNPCType->armor_tint = (atoi(row[r++]) & 0xFF);
tmpNPCType->armor_tint |= (atoi(row[r++]) & 0xFF) << 8;
tmpNPCType->armor_tint |= (atoi(row[r++]) & 0xFF) << 16;
tmpNPCType->armor_tint |= (tmpNPCType->armor_tint) ? (0xFF << 24) : 0;

tmpNPCType->see_invis = atoi(row[r++])==0?false:true; // Mongrel: Set see_invis flag
...


...should be changed to...


...
tmpNPCType->drakkin_details = atoi(row[r++]);
tmpNPCType->armor_tint = (atoi(row[r++]) & 0xFF) << 16;
tmpNPCType->armor_tint |= (atoi(row[r++]) & 0xFF) << 8;
tmpNPCType->armor_tint |= (atoi(row[r++]) & 0xFF);
tmpNPCType->armor_tint |= (tmpNPCType->armor_tint) ? (0xFF << 24) : 0;

tmpNPCType->see_invis = atoi(row[r++])==0?false:true; // Mongrel: Set see_invis flag
...


Just swapping the "(...0xFF) << 16;" and "(...0xFF);" lines and adjusting the "=" and "|=" to correlate.

- Shendare

ChaosSlayerZ
05-25-2009, 03:31 AM
isn't it simpler to just rename the collumns? :D

trevius
05-25-2009, 05:55 AM
Thanks for the quick fix, Shendare. I got it added to the SVN.