Core/Spells: Fixed crash in triggered spells with SPELL_ATTR2_RETAIN_ITEM_CAST

Port From (https://github.com/TrinityCore/TrinityCore/commit/80a5d475eed2438664941b31c9f32d719ba312d1)
This commit is contained in:
hondacrx
2022-06-24 21:45:48 -04:00
parent c81639bf56
commit 345b38352f
+1 -1
View File
@@ -314,7 +314,7 @@ namespace Game.Spells
args.OriginalCastItemLevel = m_castItemLevel;
if (!m_castItemGUID.IsEmpty() && Global.SpellMgr.GetSpellInfo(effectInfo.TriggerSpell, m_caster.GetMap().GetDifficultyID()).HasAttribute(SpellAttr2.RetainItemCast))
{
Player triggeringAuraCaster = args.TriggeringAura.GetCaster()?.ToPlayer();
Player triggeringAuraCaster = m_caster?.ToPlayer();
if (triggeringAuraCaster != null)
args.CastItem = triggeringAuraCaster.GetItemByGuid(m_castItemGUID);
}