mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[10519] Fix delaying spell with 2 or more persistent area auras and store ObjectGuid instead of Unit* on DynamicObject affected set
This commit is contained in:
parent
14127b4d08
commit
5d8cd04f97
3 changed files with 39 additions and 8 deletions
|
|
@ -147,9 +147,40 @@ void DynamicObject::Delete()
|
|||
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, GetCasterGUID());
|
||||
for(AffectedSet::iterator iter = m_affected.begin(); iter != m_affected.end(); )
|
||||
{
|
||||
Unit *target = GetMap()->GetUnit((*iter));
|
||||
if (target)
|
||||
{
|
||||
SpellAuraHolder *holder = target->GetSpellAuraHolder(m_spellId, GetCasterGUID());
|
||||
if (!holder)
|
||||
{
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
|
||||
bool foundAura = false;
|
||||
for (int32 i = m_effIndex + 1; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->m_auras[i])
|
||||
{
|
||||
foundAura = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundAura)
|
||||
{
|
||||
++iter;
|
||||
continue;
|
||||
}
|
||||
|
||||
target->DelaySpellAuraHolder(m_spellId, delaytime, GetCasterGUID());
|
||||
++iter;
|
||||
}
|
||||
else
|
||||
m_affected.erase(iter);
|
||||
}
|
||||
}
|
||||
|
||||
bool DynamicObject::isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue