mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10896] Detect self-referenced model info in creature_model_info.
This commit is contained in:
parent
e34d73f6bd
commit
add4ceb999
2 changed files with 23 additions and 7 deletions
|
|
@ -1022,16 +1022,32 @@ void ObjectMgr::LoadCreatureModelInfo()
|
||||||
const_cast<CreatureModelInfo*>(minfo)->gender = GENDER_MALE;
|
const_cast<CreatureModelInfo*>(minfo)->gender = GENDER_MALE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minfo->modelid_other_gender && !sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_other_gender))
|
if (minfo->modelid_other_gender)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table `creature_model_info` has nonexistent modelid_other_gender model (%u) defined for model id %u.", minfo->modelid_other_gender, minfo->modelid);
|
if (minfo->modelid_other_gender == minfo->modelid)
|
||||||
const_cast<CreatureModelInfo*>(minfo)->modelid_other_gender = 0;
|
{
|
||||||
|
sLog.outErrorDb("Table `creature_model_info` has redundent modelid_other_gender model (%u) defined for model id %u.", minfo->modelid_other_gender, minfo->modelid);
|
||||||
|
const_cast<CreatureModelInfo*>(minfo)->modelid_other_gender = 0;
|
||||||
|
}
|
||||||
|
else if (!sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_other_gender))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `creature_model_info` has nonexistent modelid_other_gender model (%u) defined for model id %u.", minfo->modelid_other_gender, minfo->modelid);
|
||||||
|
const_cast<CreatureModelInfo*>(minfo)->modelid_other_gender = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minfo->modelid_alternative && !sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_alternative))
|
if (minfo->modelid_alternative)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table `creature_model_info` has nonexistent modelid_alternative model (%u) defined for model id %u.", minfo->modelid_alternative, minfo->modelid);
|
if (minfo->modelid_alternative == minfo->modelid)
|
||||||
const_cast<CreatureModelInfo*>(minfo)->modelid_alternative = 0;
|
{
|
||||||
|
sLog.outErrorDb("Table `creature_model_info` has redundent modelid_alternative model (%u) defined for model id %u.", minfo->modelid_alternative, minfo->modelid);
|
||||||
|
const_cast<CreatureModelInfo*>(minfo)->modelid_alternative = 0;
|
||||||
|
}
|
||||||
|
else if (!sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_alternative))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `creature_model_info` has nonexistent modelid_alternative model (%u) defined for model id %u.", minfo->modelid_alternative, minfo->modelid);
|
||||||
|
const_cast<CreatureModelInfo*>(minfo)->modelid_alternative = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10895"
|
#define REVISION_NR "10896"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue