mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 23:38:54 -04:00
Core/Items: Fixed crash in selecting azerite essences
* Also fixed OVERRIDE_SPELLS auras for SPELLFAMILY_GENERIC
This commit is contained in:
@@ -14304,17 +14304,24 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/
|
||||
|
||||
SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo) const
|
||||
{
|
||||
Unit::AuraEffectList swaps = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS);
|
||||
Unit::AuraEffectList const& swaps2 = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED);
|
||||
if (!swaps2.empty())
|
||||
swaps.insert(swaps.end(), swaps2.begin(), swaps2.end());
|
||||
|
||||
for (AuraEffect const* auraEffect : swaps)
|
||||
auto findMatchingAuraEffectIn = [this, spellInfo](AuraType type) -> SpellInfo const*
|
||||
{
|
||||
if (uint32(auraEffect->GetMiscValue()) == spellInfo->Id || auraEffect->IsAffectingSpell(spellInfo))
|
||||
if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo(auraEffect->GetAmount()))
|
||||
return newInfo;
|
||||
}
|
||||
for (AuraEffect const* auraEffect : GetAuraEffectsByType(type))
|
||||
{
|
||||
bool matches = auraEffect->GetMiscValue() ? uint32(auraEffect->GetMiscValue()) == spellInfo->Id : auraEffect->IsAffectingSpell(spellInfo);
|
||||
if (matches)
|
||||
if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo(auraEffect->GetAmount()))
|
||||
return newInfo;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
if (SpellInfo const* newInfo = findMatchingAuraEffectIn(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS))
|
||||
return newInfo;
|
||||
|
||||
if (SpellInfo const* newInfo = findMatchingAuraEffectIn(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED))
|
||||
return newInfo;
|
||||
|
||||
return spellInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user