diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index bd044a1aa..46c6f01fa 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1022,16 +1022,32 @@ void ObjectMgr::LoadCreatureModelInfo() const_cast(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); - const_cast(minfo)->modelid_other_gender = 0; + if (minfo->modelid_other_gender == minfo->modelid) + { + 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(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(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); - const_cast(minfo)->modelid_alternative = 0; + if (minfo->modelid_alternative == minfo->modelid) + { + sLog.outErrorDb("Table `creature_model_info` has redundent modelid_alternative model (%u) defined for model id %u.", minfo->modelid_alternative, minfo->modelid); + const_cast(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(minfo)->modelid_alternative = 0; + } } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 358c1ef74..c2f907043 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 "10895" + #define REVISION_NR "10896" #endif // __REVISION_NR_H__