mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[10120] Check expected creature_model_info data for player races
This commit is contained in:
parent
b8942160be
commit
fdcbd7d5f5
2 changed files with 59 additions and 1 deletions
|
|
@ -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<CreatureModelInfo*>(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<CreatureModelInfo*>(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<CreatureModelInfo*>(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<CreatureModelInfo*>(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( ">> Loaded %u creature model based info", sCreatureModelStorage.RecordCount );
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10119"
|
#define REVISION_NR "10120"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue