[7475] Move Player::IsInFeralForm to Unit::IsInFeralForm

This commit is contained in:
VladimirMangos 2009-03-16 23:22:07 +03:00
parent 816862db65
commit c99a849eb9
5 changed files with 7 additions and 5 deletions

View file

@ -1161,7 +1161,6 @@ class MANGOS_DLL_SPEC Player : public Unit
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
uint32 GetArmorProficiency() const { return m_ArmorProficiency; }
bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
bool IsUseEquipedWeapon( bool mainhand ) const
{
// disarm applied only to mainhand weapon

View file

@ -3327,7 +3327,7 @@ void Aura::HandleAuraModDisarm(bool apply, bool Real)
return;
// main-hand attack speed already set to special value for feral form already and don't must change and reset at remove.
if (((Player *)m_target)->IsInFeralForm())
if (m_target->IsInFeralForm())
return;
if (apply)

View file

@ -2842,7 +2842,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target)
if(attType != BASE_ATTACK && !item )
return 0;
if(((Player*)this)->IsInFeralForm())
if(IsInFeralForm())
return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact
// weapon skill or (unarmed for base attack)
@ -9645,7 +9645,7 @@ uint32 Unit::GetCreatureType() const
{
if(GetTypeId() == TYPEID_PLAYER)
{
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(((Player*)this)->m_form);
SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(m_form);
if(ssEntry && ssEntry->creatureType > 0)
return ssEntry->creatureType;
else

View file

@ -1197,8 +1197,11 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
uint64 m_ObjectSlot[4];
uint32 m_detectInvisibilityMask;
uint32 m_invisibilityMask;
uint32 m_ShapeShiftFormSpellId;
ShapeshiftForm m_form;
bool IsInFeralForm() const { return m_form == FORM_CAT || m_form == FORM_BEAR || m_form == FORM_DIREBEAR; }
float m_modMeleeHitChance;
float m_modRangedHitChance;
float m_modSpellHitChance;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7474"
#define REVISION_NR "7475"
#endif // __REVISION_NR_H__