[12017] Add support for getRace() of creatures. Thanks to vladimir for input

This commit is contained in:
Schmoozerd 2012-06-24 19:28:11 +02:00
parent dfa35dafab
commit fb3a990b13
6 changed files with 16 additions and 9 deletions

View file

@ -2168,6 +2168,11 @@ bool Creature::HasSpellCooldown(uint32 spell_id) const
return (itr != m_CreatureSpellCooldowns.end() && itr->second > time(NULL)) || HasCategoryCooldown(spell_id);
}
uint8 Creature::getRace() const
{
return Unit::getRace() ? Unit::getRace() : GetCreatureModelRace(GetNativeDisplayId());
}
bool Creature::IsInEvadeMode() const
{
return !i_motionMaster.empty() && i_motionMaster.GetCurrentMovementGeneratorType() == HOME_MOTION_TYPE;