diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index e6f9a0168..b6c687667 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -1030,6 +1030,64 @@ void ObjectMgr::LoadCreatureModelInfo() } } + // character races expected have model info data in table + for(uint32 race = 1; race < sChrRacesStore.GetNumRows(); ++race) + { + ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race); + if (!raceEntry) + continue; + + if (!((1 << (race-1)) & RACEMASK_ALL_PLAYABLE)) + continue; + + if (CreatureModelInfo const *minfo = GetCreatureModelInfo(raceEntry->model_f)) + { + if (minfo->gender != GENDER_FEMALE) + sLog.outErrorDb("Table `creature_model_info` have wrong gender %u for character race %u female model id %u", minfo->gender, race, raceEntry->model_f); + + if (minfo->modelid_other_gender != raceEntry->model_m) + sLog.outErrorDb("Table `creature_model_info` have wrong other gender model id %u for character race %u female model id %u", minfo->modelid_other_gender, race, raceEntry->model_f); + + if (minfo->bounding_radius <= 0.0f) + { + sLog.outErrorDb("Table `creature_model_info` have wrong bounding_radius %f for character race %u female model id %u, use %f instead", minfo->bounding_radius, race, raceEntry->model_f, DEFAULT_WORLD_OBJECT_SIZE); + const_cast(minfo)->bounding_radius = DEFAULT_WORLD_OBJECT_SIZE; + } + + if (minfo->combat_reach != 1.5f) + { + sLog.outErrorDb("Table `creature_model_info` have wrong combat_reach %f for character race %u female model id %u, expected always 1.5f", minfo->combat_reach, race, raceEntry->model_f); + const_cast(minfo)->combat_reach = 1.5f; + } + } + else + sLog.outErrorDb("Table `creature_model_info` expect have data for character race %u female model id %u", race, raceEntry->model_f); + + if (CreatureModelInfo const *minfo = GetCreatureModelInfo(raceEntry->model_m)) + { + if (minfo->gender != GENDER_MALE) + sLog.outErrorDb("Table `creature_model_info` have wrong gender %u for character race %u male model id %u", minfo->gender, race, raceEntry->model_m); + + if (minfo->modelid_other_gender != raceEntry->model_f) + sLog.outErrorDb("Table `creature_model_info` have wrong other gender model id %u for character race %u male model id %u", minfo->modelid_other_gender, race, raceEntry->model_m); + + if (minfo->bounding_radius <= 0.0f) + { + sLog.outErrorDb("Table `creature_model_info` have wrong bounding_radius %f for character race %u male model id %u, use %f instead", minfo->bounding_radius, race, raceEntry->model_f, DEFAULT_WORLD_OBJECT_SIZE); + const_cast(minfo)->bounding_radius = DEFAULT_WORLD_OBJECT_SIZE; + } + + if (minfo->combat_reach != 1.5f) + { + sLog.outErrorDb("Table `creature_model_info` have wrong combat_reach %f for character race %u male model id %u, expected always 1.5f", minfo->combat_reach, race, raceEntry->model_m); + const_cast(minfo)->combat_reach = 1.5f; + } + } + else + sLog.outErrorDb("Table `creature_model_info` expect have data for character race %u male model id %u", race, raceEntry->model_m); + + } + sLog.outString( ">> Loaded %u creature model based info", sCreatureModelStorage.RecordCount ); sLog.outString(); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2c5cf35b2..097eec9eb 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 "10119" + #define REVISION_NR "10120" #endif // __REVISION_NR_H__