mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8295] Remove single target auras at caster/target shift to not accessable phase.
This must fix another source of "Couldn't find the caster of the single target aura" errors.
This commit is contained in:
parent
4841fae910
commit
822a34e2c7
3 changed files with 22 additions and 5 deletions
|
|
@ -3878,13 +3878,24 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::RemoveNotOwnSingleTargetAuras()
|
void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase)
|
||||||
{
|
{
|
||||||
// single target auras from other casters
|
// single target auras from other casters
|
||||||
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
|
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
|
||||||
{
|
{
|
||||||
if (iter->second->GetCasterGUID()!=GetGUID() && IsSingleTargetSpell(iter->second->GetSpellProto()))
|
if (iter->second->GetCasterGUID()!=GetGUID() && IsSingleTargetSpell(iter->second->GetSpellProto()))
|
||||||
|
{
|
||||||
|
if(!newPhase)
|
||||||
RemoveAura(iter);
|
RemoveAura(iter);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Unit* caster = iter->second->GetCaster();
|
||||||
|
if(!caster || !caster->InSamePhase(newPhase))
|
||||||
|
RemoveAura(iter);
|
||||||
|
else
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|
@ -3894,7 +3905,7 @@ void Unit::RemoveNotOwnSingleTargetAuras()
|
||||||
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end(); )
|
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end(); )
|
||||||
{
|
{
|
||||||
Aura* aura = *iter;
|
Aura* aura = *iter;
|
||||||
if (aura->GetTarget() != this)
|
if (aura->GetTarget() != this && !aura->GetTarget()->InSamePhase(newPhase))
|
||||||
{
|
{
|
||||||
scAuras.erase(iter); // explicitly remove, instead waiting remove in RemoveAura
|
scAuras.erase(iter); // explicitly remove, instead waiting remove in RemoveAura
|
||||||
aura->GetTarget()->RemoveAura(aura);
|
aura->GetTarget()->RemoveAura(aura);
|
||||||
|
|
@ -11823,6 +11834,12 @@ void Unit::RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo)
|
||||||
|
|
||||||
void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||||
{
|
{
|
||||||
|
if(newPhaseMask==GetPhaseMask())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(IsInWorld())
|
||||||
|
RemoveNotOwnSingleTargetAuras(newPhaseMask); // we can lost access to caster or target
|
||||||
|
|
||||||
WorldObject::SetPhaseMask(newPhaseMask,update);
|
WorldObject::SetPhaseMask(newPhaseMask,update);
|
||||||
|
|
||||||
if(IsInWorld())
|
if(IsInWorld())
|
||||||
|
|
|
||||||
|
|
@ -1209,7 +1209,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
|
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
|
||||||
void RemoveAurasDueToSpellByCancel(uint32 spellId);
|
void RemoveAurasDueToSpellByCancel(uint32 spellId);
|
||||||
void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo);
|
void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo);
|
||||||
void RemoveNotOwnSingleTargetAuras();
|
void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0);
|
||||||
|
|
||||||
void RemoveSpellsCausingAura(AuraType auraType);
|
void RemoveSpellsCausingAura(AuraType auraType);
|
||||||
void RemoveRankAurasDueToSpell(uint32 spellId);
|
void RemoveRankAurasDueToSpell(uint32 spellId);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8294"
|
#define REVISION_NR "8295"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue