[10486] Use casterGUID check for delaying holder since possible stacking same spell from different casters

This commit is contained in:
Laise 2010-09-15 11:35:33 +02:00
parent 63cdd66bcb
commit abbf4f5331
5 changed files with 10 additions and 7 deletions

View file

@ -149,7 +149,7 @@ void DynamicObject::Delay(int32 delaytime)
m_aliveDuration -= delaytime;
for(AffectedSet::iterator iunit= m_affected.begin(); iunit != m_affected.end(); ++iunit)
if (*iunit)
(*iunit)->DelaySpellAuraHolder(m_spellId, delaytime);
(*iunit)->DelaySpellAuraHolder(m_spellId, delaytime, GetCasterGUID());
}
bool DynamicObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const

View file

@ -6202,7 +6202,7 @@ void Spell::DelayedChannel()
if ((*ihit).missCondition == SPELL_MISS_NONE)
{
if (Unit* unit = m_caster->GetObjectGuid() == ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID))
unit->DelaySpellAuraHolder(m_spellInfo->Id, delaytime);
unit->DelaySpellAuraHolder(m_spellInfo->Id, delaytime, unit->GetGUID());
}
}

View file

@ -4783,11 +4783,14 @@ void Unit::RemoveAllAurasOnDeath()
}
}
void Unit::DelaySpellAuraHolder(uint32 spellId, int32 delaytime)
void Unit::DelaySpellAuraHolder(uint32 spellId, int32 delaytime, uint64 casterGUID)
{
SpellAuraHolderBounds bounds = GetSpellAuraHolderBounds(spellId);
for (SpellAuraHolderMap::iterator iter = bounds.first; iter != bounds.second; ++iter)
{
if (casterGUID != iter->second->GetCasterGUID())
continue;
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (Aura *aur = iter->second->GetAuraByEffectIndex(SpellEffectIndex(i)))
@ -4797,7 +4800,7 @@ void Unit::DelaySpellAuraHolder(uint32 spellId, int32 delaytime)
else
aur->SetAuraDuration(aur->GetAuraDuration() - delaytime);
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell %u partially interrupted on unit %u, new duration: %u ms",spellId, GetGUIDLow(), aur->GetAuraDuration());
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell %u, EffectIndex %u partially interrupted on unit %u, new duration: %u ms",spellId, i, GetGUIDLow(), aur->GetAuraDuration());
}
}
iter->second->SendAuraUpdate(false);

View file

@ -1551,7 +1551,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void RemoveAuraHolderFromStack(uint32 spellId, int32 stackAmount = 1, uint64 casterGUID = 0, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAuraHolderDueToSpellByDispel(uint32 spellId, int32 stackAmount, uint64 casterGUID, Unit *dispeler);
void DelaySpellAuraHolder(uint32 spellId, int32 delaytime);
void DelaySpellAuraHolder(uint32 spellId, int32 delaytime, uint64 casterGUID);
float GetResistanceBuffMods(SpellSchools school, bool positive) const { return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school ); }
void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school,val); }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10485"
#define REVISION_NR "10486"
#endif // __REVISION_NR_H__