Fixed a crash when trying to summon a companion pet.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user