Fix item Unk0 field type as expected signed and related log output.

Also restore item class check at server loading but not subclass check. Problems only with subclass check case.
This commit is contained in:
VladimirMangos 2009-01-15 00:39:10 +03:00
parent b19c0da601
commit c0824b35c6
5 changed files with 17 additions and 12 deletions

View file

@ -322,7 +322,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
data << pProto->ItemId; data << pProto->ItemId;
data << pProto->Class; data << pProto->Class;
data << pProto->SubClass; data << pProto->SubClass;
data << pProto->Unk0; // new 2.0.3, not exist in wdb cache? data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache?
data << Name; data << Name;
data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name... data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00); data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00);

View file

@ -489,7 +489,7 @@ struct ItemPrototype
uint32 ItemId; uint32 ItemId;
uint32 Class; // id from ItemClass.dbc uint32 Class; // id from ItemClass.dbc
uint32 SubClass; // id from ItemSubClass.dbc uint32 SubClass; // id from ItemSubClass.dbc
uint32 Unk0; int32 Unk0;
char* Name1; char* Name1;
uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc
uint32 Quality; uint32 Quality;

View file

@ -1598,18 +1598,23 @@ void ObjectMgr::LoadItemPrototypes()
if(dbcitem) if(dbcitem)
{ {
/* disabled: have some strange wrong cases for Class/Subclass values. if(proto->Class != dbcitem->Class)
for enable also uncomment Class/Sublcas fields in ItemEntry structure and in Itemfmt[] {
if(proto->Class != dbcitem->Class || proto->SubClass != dbcitem->SubClass) sLog.outErrorDb("Item (Entry: %u) not correct ñlass %u, must be %u (still using DB value).",i,proto->Class,dbcitem->Class);
// It safe let use Class from DB
}
/* disabled: have some strange wrong cases for Subclass values.
for enable also uncomment Subclass field in ItemEntry structure and in Itemfmt[]
if(proto->SubClass != dbcitem->SubClass)
{ {
sLog.outErrorDb("Item (Entry: %u) not correct (Class: %u, Sub: %u) pair, must be (Class: %u, Sub: %u) (still using DB value).",i,proto->Class,proto->SubClass,dbcitem->Class,dbcitem->SubClass); sLog.outErrorDb("Item (Entry: %u) not correct (Class: %u, Sub: %u) pair, must be (Class: %u, Sub: %u) (still using DB value).",i,proto->Class,proto->SubClass,dbcitem->Class,dbcitem->SubClass);
// It safe let use Class/Subclass from DB // It safe let use Subclass from DB
} }
*/ */
if(proto->Unk0 != dbcitem->Unk0) if(proto->Unk0 != dbcitem->Unk0)
{ {
sLog.outErrorDb("Item (Entry: %u) not correct %u Unk0, must be %u (still using DB value).",i,proto->Unk0,dbcitem->Unk0); sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).",i,proto->Unk0,dbcitem->Unk0);
// It safe let use Unk0 from DB // It safe let use Unk0 from DB
} }

View file

@ -809,9 +809,9 @@ struct GtRegenMPPerSptEntry
struct ItemEntry struct ItemEntry
{ {
uint32 ID; // 0 uint32 ID; // 0
//uint32 Class; // 1 uint32 Class; // 1
//uint32 SubClass; // 2 //uint32 SubClass; // 2 some items have strnage subclasses
uint32 Unk0; // 3 int32 Unk0; // 3
int32 Material; // 4 int32 Material; // 4
uint32 DisplayId; // 5 uint32 DisplayId; // 5
uint32 InventoryType; // 6 uint32 InventoryType; // 6

View file

@ -51,7 +51,7 @@ const char GtOCTRegenHPfmt[]="f";
//const char GtOCTRegenMPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f";
const char GtRegenHPPerSptfmt[]="f"; const char GtRegenHPPerSptfmt[]="f";
const char GtRegenMPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="f";
const char Itemfmt[]="nxxiiiii"; const char Itemfmt[]="nixiiiii";
//const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx";
//const char ItemCondExtCostsEntryfmt[]="xiii"; //const char ItemCondExtCostsEntryfmt[]="xiii";
const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix"; const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix";