Core/Commands: Fixes a crash when spell doesnt have Effect
This commit is contained in:
@@ -1128,9 +1128,9 @@ namespace Game.Chat
|
|||||||
|
|
||||||
bool known = target && target.HasSpell(spellInfo.Id);
|
bool known = target && target.HasSpell(spellInfo.Id);
|
||||||
SpellEffectInfo effect = spellInfo.GetEffect(0);
|
SpellEffectInfo effect = spellInfo.GetEffect(0);
|
||||||
bool learn = (effect.Effect == SpellEffectName.LearnSpell);
|
bool learn = effect?.Effect == SpellEffectName.LearnSpell;
|
||||||
|
|
||||||
SpellInfo learnSpellInfo = Global.SpellMgr.GetSpellInfo(effect.TriggerSpell, spellInfo.Difficulty);
|
SpellInfo learnSpellInfo = effect != null ? Global.SpellMgr.GetSpellInfo(effect.TriggerSpell, spellInfo.Difficulty) : null;
|
||||||
|
|
||||||
bool talent = spellInfo.HasAttribute(SpellCustomAttributes.IsTalent);
|
bool talent = spellInfo.HasAttribute(SpellCustomAttributes.IsTalent);
|
||||||
bool passive = spellInfo.IsPassive();
|
bool passive = spellInfo.IsPassive();
|
||||||
|
|||||||
Reference in New Issue
Block a user