Core/Auras: Registering a new owned aura will now search existing owned auras instead of applied auras to check for unstackable one
Port From (https://github.com/TrinityCore/TrinityCore/commit/dc661a34b1d1e099e2c1854e8fa9446115e30c96)
This commit is contained in:
@@ -3937,7 +3937,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
Aura aura = aurApp.GetBase();
|
Aura aura = aurApp.GetBase();
|
||||||
|
|
||||||
_RemoveNoStackAurasDueToAura(aura);
|
_RemoveNoStackAurasDueToAura(aura, false);
|
||||||
|
|
||||||
if (aurApp.HasRemoveMode())
|
if (aurApp.HasRemoveMode())
|
||||||
return;
|
return;
|
||||||
@@ -3995,7 +3995,7 @@ namespace Game.Entities
|
|||||||
Cypher.Assert(!m_cleanupDone);
|
Cypher.Assert(!m_cleanupDone);
|
||||||
m_ownedAuras.Add(aura.GetId(), aura);
|
m_ownedAuras.Add(aura.GetId(), aura);
|
||||||
|
|
||||||
_RemoveNoStackAurasDueToAura(aura);
|
_RemoveNoStackAurasDueToAura(aura, true);
|
||||||
|
|
||||||
if (aura.IsRemoved())
|
if (aura.IsRemoved())
|
||||||
return;
|
return;
|
||||||
@@ -4084,7 +4084,7 @@ namespace Game.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _RemoveNoStackAurasDueToAura(Aura aura)
|
void _RemoveNoStackAurasDueToAura(Aura aura, bool owned)
|
||||||
{
|
{
|
||||||
SpellInfo spellProto = aura.GetSpellInfo();
|
SpellInfo spellProto = aura.GetSpellInfo();
|
||||||
|
|
||||||
@@ -4098,13 +4098,10 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var app in GetAppliedAuras())
|
if (owned)
|
||||||
{
|
RemoveOwnedAuras(ownedAura => !aura.CanStackWith(ownedAura), AuraRemoveMode.Default);
|
||||||
if (aura.CanStackWith(app.Value.GetBase()))
|
else
|
||||||
continue;
|
RemoveAppliedAuras(appliedAura => !aura.CanStackWith(appliedAura.GetBase()), AuraRemoveMode.Default);
|
||||||
|
|
||||||
RemoveAura(app, AuraRemoveMode.Default);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public int GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect aurEff, AuraType auraType, bool checkMiscValue = false, int miscValue = 0)
|
public int GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect aurEff, AuraType auraType, bool checkMiscValue = false, int miscValue = 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user