From d53b43024a4121819e32872cad98af3ee0c52dc0 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 14 Jan 2009 00:29:06 +0300 Subject: [PATCH] [7080] More `item_template` data checks at loading. Not all checks can be 100% correct result possible. Plerase, report proved wrong output and this checks part will disabled. --- src/game/ObjectMgr.cpp | 18 ++++++++++++++++++ src/shared/Database/DBCStructure.h | 8 ++++---- src/shared/Database/DBCfmt.cpp | 2 +- src/shared/revision_nr.h | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 202abd374..55f9dc6df 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1598,6 +1598,24 @@ void ObjectMgr::LoadItemPrototypes() if(dbcitem) { + if(proto->Class != dbcitem->Class || 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); + // It safe let use InventoryType from DB + } + + 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); + // It safe let use InventoryType from DB + } + + if(proto->Material != dbcitem->Material) + { + sLog.outErrorDb("Item (Entry: %u) not correct %u material, must be %u (still using DB value).",i,proto->Material,dbcitem->Material); + // It safe let use InventoryType from DB + } + if(proto->InventoryType != dbcitem->InventoryType) { sLog.outErrorDb("Item (Entry: %u) not correct %u inventory type, must be %u (still using DB value).",i,proto->InventoryType,dbcitem->InventoryType); diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h index 5a2a96761..bbd7fc475 100644 --- a/src/shared/Database/DBCStructure.h +++ b/src/shared/Database/DBCStructure.h @@ -809,10 +809,10 @@ struct GtRegenMPPerSptEntry struct ItemEntry { uint32 ID; - //uint32 Class; - //uint32 SubClass; - //uint32 Unk0; - //uint32 Material; + uint32 Class; + uint32 SubClass; + uint32 Unk0; + uint32 Material; uint32 DisplayId; uint32 InventoryType; uint32 Sheath; diff --git a/src/shared/Database/DBCfmt.cpp b/src/shared/Database/DBCfmt.cpp index b5a1843bc..fdadc8173 100644 --- a/src/shared/Database/DBCfmt.cpp +++ b/src/shared/Database/DBCfmt.cpp @@ -51,7 +51,7 @@ const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="f"; -const char Itemfmt[]="nxxxxiii"; +const char Itemfmt[]="niiiiiii"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiix"; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 31ea70372..b921fbd5c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7079" + #define REVISION_NR "7080" #endif // __REVISION_NR_H__