diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index a87776235..64734f1ee 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -1068,6 +1068,9 @@ namespace Game.Entities public void CastSpell(SpellCastTargets targets, uint spellId, CastSpellExtraArgs args) { + if (args == null) + args = new CastSpellExtraArgs(); + SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, args.CastDifficulty != Difficulty.None ? args.CastDifficulty : GetMap().GetDifficultyID()); if (spellInfo == null) { @@ -1075,9 +1078,6 @@ namespace Game.Entities return; } - if (args == null) - args = new CastSpellExtraArgs(); - Spell spell = new(this, spellInfo, args.TriggerFlags, args.OriginalCaster); foreach (var pair in args.SpellValueOverrides) spell.SetSpellValue(pair.Key, pair.Value);