aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-10 01:19:39 -0500
committermegamage <none@none>2009-05-10 01:19:39 -0500
commitaba285664fe9660a545bb4abc3d31cedb5142540 (patch)
treeb00502dc7dd43699b6e00b215535df9df4a21dc4 /src
parent9215f0ee11ee6c9236c706b5673f0455d4dcc751 (diff)
*Fix the bug that totem can only apply the first aura effect.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp4
-rw-r--r--src/game/SpellAuras.cpp30
-rw-r--r--src/game/Unit.cpp4
3 files changed, 20 insertions, 18 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 122caa96373..5d4dae7f0b5 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1188,8 +1188,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if (aura_effmask)
{
- Unit * caster = m_originalCaster ? m_originalCaster : m_caster;
- Aura * Aur= new Aura(m_spellInfo, aura_effmask, &m_currentBasePoints[0], unit, caster , m_CastItem, m_caster);
+ Unit * caster = m_originalCaster ? m_originalCaster : m_caster;
+ Aura * Aur = new Aura(m_spellInfo, aura_effmask, m_currentBasePoints, unit, caster, m_CastItem, m_caster);
if (!Aur->IsAreaAura())
{
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index b8f65626e7d..3045e89f315 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -721,28 +721,28 @@ void AreaAuraEffect::Update(uint32 diff)
}
}
- for(std::list<Unit *>::iterator tIter = targets.begin(); tIter != targets.end(); tIter++)
+ for(std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end(); tIter++)
{
- bool skip=false;
- for(Unit::AuraMap::iterator iter = (*tIter)->GetAuras().begin(); iter != (*tIter)->GetAuras().end();++iter)
+ if(Aura *aur = (*tIter)->GetAura(GetId(), m_formalCasterGUID))
{
- bool samecaster = iter->second->GetCasterGUID() == GetCasterGUID();
- if (samecaster && iter->first == GetId())
+ if(aur->HasEffect(GetEffIndex()))
+ continue;
+ }
+ else
+ {
+ bool skip = false;
+ for(Unit::AuraMap::iterator iter = (*tIter)->GetAuras().begin(); iter != (*tIter)->GetAuras().end();++iter)
{
- if (AuraEffect * aurEff = iter->second->GetPartAura(m_effIndex))
+ bool samecaster = iter->second->GetCasterGUID() == m_formalCasterGUID;
+ if(spellmgr.IsNoStackSpellDueToSpell(GetId(), iter->first, samecaster))
{
- skip=true;
+ skip = true;
+ break;
}
- break;
- }
- if (spellmgr.IsNoStackSpellDueToSpell(GetId(), iter->first,samecaster))
- {
- skip=true;
- break;
}
+ if(skip)
+ continue;
}
- if(skip)
- continue;
if(SpellEntry const *actualSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(GetSpellProto(), (*tIter)->getLevel()))
{
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 7a3385acabf..6a9f122adf4 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4306,7 +4306,7 @@ bool Unit::HasAura(Aura * aur) const
bool Unit::HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const
{
if (Aura * aur = GetAura(spellId, caster))
- return bool(aur->HasEffect(effIndex));
+ return aur->HasEffect(effIndex);
return false;
}
@@ -13615,6 +13615,8 @@ Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* c
// can't do that for passive auras - they stack from same caster so there is no way to get exact aura which should get effect
//assert (!IsPassiveSpell(spellInfo));
+ sLog.outDebug("AddAuraEffect: spell id: %u, effect index: %u", spellInfo->Id, (uint32)effIndex);
+
Aura *aur = GetAura(spellInfo->Id, caster->GetGUID());
if (aur)