*Fix a typo causing all auras to be on cooldown
--HG-- branch : trunk
This commit is contained in:
@@ -772,6 +772,7 @@ void AreaAuraEffect::Update(uint32 diff)
|
|||||||
if (GetParentAura()->IsRemoved())
|
if (GetParentAura()->IsRemoved())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Caster may be deleted due to update
|
||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
uint32 tmp_spellId = GetId();
|
uint32 tmp_spellId = GetId();
|
||||||
uint32 tmp_effIndex = GetEffIndex();
|
uint32 tmp_effIndex = GetEffIndex();
|
||||||
@@ -783,12 +784,12 @@ void AreaAuraEffect::Update(uint32 diff)
|
|||||||
bool needFriendly = (m_areaAuraType == AREA_AURA_ENEMY ? false : true);
|
bool needFriendly = (m_areaAuraType == AREA_AURA_ENEMY ? false : true);
|
||||||
if( !caster || caster->hasUnitState(UNIT_STAT_ISOLATED) ||
|
if( !caster || caster->hasUnitState(UNIT_STAT_ISOLATED) ||
|
||||||
!caster->HasAuraEffect(tmp_spellId, tmp_effIndex) ||
|
!caster->HasAuraEffect(tmp_spellId, tmp_effIndex) ||
|
||||||
caster->IsFriendlyTo(tmp_target) != needFriendly
|
caster->IsFriendlyTo(m_target) != needFriendly
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
m_target->RemoveAura(GetParentAura());
|
m_target->RemoveAura(GetParentAura());
|
||||||
}
|
}
|
||||||
else if (!caster->IsWithinDistInMap(tmp_target, m_radius))
|
else if (!caster->IsWithinDistInMap(m_target, m_radius))
|
||||||
{
|
{
|
||||||
if (needFriendly)
|
if (needFriendly)
|
||||||
{
|
{
|
||||||
@@ -805,17 +806,17 @@ void AreaAuraEffect::Update(uint32 diff)
|
|||||||
m_removeTime = FRIENDLY_AA_REMOVE_TIME;
|
m_removeTime = FRIENDLY_AA_REMOVE_TIME;
|
||||||
if( m_areaAuraType == AREA_AURA_PARTY) // check if in same sub group
|
if( m_areaAuraType == AREA_AURA_PARTY) // check if in same sub group
|
||||||
{
|
{
|
||||||
if(!tmp_target->IsInPartyWith(caster))
|
if(!m_target->IsInPartyWith(caster))
|
||||||
m_target->RemoveAura(GetParentAura());
|
m_target->RemoveAura(GetParentAura());
|
||||||
}
|
}
|
||||||
else if( m_areaAuraType == AREA_AURA_RAID)
|
else if( m_areaAuraType == AREA_AURA_RAID)
|
||||||
{
|
{
|
||||||
if(!tmp_target->IsInRaidWith(caster))
|
if(!m_target->IsInRaidWith(caster))
|
||||||
m_target->RemoveAura(GetParentAura());
|
m_target->RemoveAura(GetParentAura());
|
||||||
}
|
}
|
||||||
else if( m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER )
|
else if( m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER )
|
||||||
{
|
{
|
||||||
if( tmp_target->GetGUID() != caster->GetCharmerOrOwnerGUID() )
|
if( m_target->GetGUID() != caster->GetCharmerOrOwnerGUID() )
|
||||||
m_target->RemoveAura(GetParentAura());
|
m_target->RemoveAura(GetParentAura());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -942,7 +943,7 @@ void Aura::_AddAura()
|
|||||||
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
|
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
// Do not apply cooldown for caster passive spells (needed by Reincarnation)
|
// Do not apply cooldown for caster passive spells (needed by Reincarnation)
|
||||||
if (!(caster->HasSpell(GetId()) && IsPassive()) && !(m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE))
|
if (!(caster->HasSpell(GetId()) && IsPassive()) && m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
|
||||||
{
|
{
|
||||||
Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
|
Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
|
||||||
((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
|
((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
|
||||||
|
|||||||
@@ -1195,7 +1195,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
|
|||||||
// spellFamilyName is Ok need check for spellFamilyMask if present
|
// spellFamilyName is Ok need check for spellFamilyMask if present
|
||||||
if(spellProcEvent->spellFamilyMask)
|
if(spellProcEvent->spellFamilyMask)
|
||||||
{
|
{
|
||||||
if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0)
|
if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0)
|
||||||
return false;
|
return false;
|
||||||
active = true; // Spell added manualy -> so its active spell
|
active = true; // Spell added manualy -> so its active spell
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user