fix(Core/Spells): Auras triggered by talents/glyphs should be removed on respec. (#8671)

Fixes #8543
This commit is contained in:
UltraNix
2021-10-24 06:23:04 +02:00
committed by GitHub
parent 993570fa8b
commit 96441a91dc
8 changed files with 103 additions and 35 deletions

View File

@@ -30,6 +30,7 @@ class GameObject;
class DynamicObject;
class WorldObject;
class Aura;
class AuraEffect;
class SpellScript;
class SpellEvent;
class ByteBuffer;
@@ -264,6 +265,17 @@ struct TargetInfo
static const uint32 SPELL_INTERRUPT_NONPLAYER = 32747;
struct TriggeredByAuraSpellData
{
TriggeredByAuraSpellData() : spellInfo(nullptr), effectIndex(-1), tickNumber(0) {}
void Init(AuraEffect const* aurEff);
SpellInfo const* spellInfo;
int8 effectIndex;
uint32 tickNumber;
};
class Spell
{
friend void Unit::SetCurrentCastedSpell(Spell* pSpell);
@@ -557,7 +569,7 @@ public:
void LoadScripts();
std::list<TargetInfo>* GetUniqueTargetInfo() { return &m_UniqueTargetInfo; }
[[nodiscard]] uint32 GetTriggeredByAuraTickNumber() const { return m_triggeredByAuraTickNumber; }
[[nodiscard]] uint32 GetTriggeredByAuraTickNumber() const { return m_triggeredByAuraSpell.tickNumber; }
protected:
bool HasGlobalCooldown() const;
@@ -734,9 +746,7 @@ public:
// if need this can be replaced by Aura copy
// we can't store original aura link to prevent access to deleted auras
// and in same time need aura data and after aura deleting.
SpellInfo const* m_triggeredByAuraSpell;
int8 m_triggeredByAuraEffectIndex;
uint32 m_triggeredByAuraTickNumber;
TriggeredByAuraSpellData m_triggeredByAuraSpell;
bool m_skipCheck;
uint8 m_auraScaleMask;