[8001] Fixed display id checks for creature case.

This commit is contained in:
VladimirMangos 2009-06-12 22:04:20 +04:00
parent a8a4836e1a
commit cf7482e0c8
2 changed files with 5 additions and 3 deletions

View file

@ -558,7 +558,8 @@ void ObjectMgr::LoadCreatureTemplates()
if(cInfo->DisplayID_A2) if(cInfo->DisplayID_A2)
{ {
if(CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->DisplayID_A2)) CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->DisplayID_A2);
if(!displayEntry)
{ {
sLog.outErrorDb("Creature (Entry: %u) has non-existing DisplayID_A2 id (%u), can crash client", cInfo->Entry, cInfo->DisplayID_A2); sLog.outErrorDb("Creature (Entry: %u) has non-existing DisplayID_A2 id (%u), can crash client", cInfo->Entry, cInfo->DisplayID_A2);
const_cast<CreatureInfo*>(cInfo)->DisplayID_A2 = 0; const_cast<CreatureInfo*>(cInfo)->DisplayID_A2 = 0;
@ -572,7 +573,8 @@ void ObjectMgr::LoadCreatureTemplates()
if(cInfo->DisplayID_H2) if(cInfo->DisplayID_H2)
{ {
if(CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->DisplayID_H2)) CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->DisplayID_H2);
if(!displayEntry)
{ {
sLog.outErrorDb("Creature (Entry: %u) has non-existing DisplayID_H2 id (%u), can crash client", cInfo->Entry, cInfo->DisplayID_H2); sLog.outErrorDb("Creature (Entry: %u) has non-existing DisplayID_H2 id (%u), can crash client", cInfo->Entry, cInfo->DisplayID_H2);
const_cast<CreatureInfo*>(cInfo)->DisplayID_H2 = 0; const_cast<CreatureInfo*>(cInfo)->DisplayID_H2 = 0;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8000" #define REVISION_NR "8001"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__