[10834] Cleanup shapeshift form code.

This commit is contained in:
VladimirMangos 2010-12-07 14:01:12 +03:00
parent c3254c88ca
commit 4c02094737
10 changed files with 56 additions and 53 deletions

View file

@ -198,7 +198,6 @@ Unit::Unit()
m_extraAttacks = 0;
m_state = 0;
m_form = FORM_NONE;
m_deathState = ALIVE;
for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i)
@ -223,7 +222,6 @@ Unit::Unit()
m_detectInvisibilityMask = 0;
m_invisibilityMask = 0;
m_transform = 0;
m_ShapeShiftFormSpellId = 0;
m_canModifyStats = false;
for (int i = 0; i < MAX_SPELL_IMMUNITY; ++i)
@ -2070,7 +2068,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit *pCaster, SpellSchoolMask schoolM
if (spellProto->SpellIconID == 2253)
{
//reduces all damage taken while Stunned and in Cat Form
if (m_form == FORM_CAT && (unitflag & UNIT_FLAG_STUNNED))
if (GetShapeshiftForm() == FORM_CAT && (unitflag & UNIT_FLAG_STUNNED))
RemainingDamage -= RemainingDamage * currentAbsorb / 100;
continue;
}
@ -8908,7 +8906,7 @@ uint32 Unit::GetCreatureType() const
{
if(GetTypeId() == TYPEID_PLAYER)
{
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(m_form);
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm());
if(ssEntry && ssEntry->creatureType > 0)
return ssEntry->creatureType;
else