Core/Spells: Fixes a crash when powercosts doesnt contain the powertype.

This commit is contained in:
hondacrx
2021-03-15 01:22:23 -04:00
parent 29793b32a3
commit c521848465
+1 -1
View File
@@ -2677,7 +2677,7 @@ namespace Game.Spells
public SpellPowerCost CalcPowerCost(PowerType powerType, bool optionalCost, Unit caster, SpellSchoolMask schoolMask, Spell spell = null)
{
var spellPowerRecord = PowerCosts.First(spellPowerEntry => spellPowerEntry?.PowerType == powerType);
var spellPowerRecord = PowerCosts.FirstOrDefault(spellPowerEntry => spellPowerEntry?.PowerType == powerType);
if (spellPowerRecord == null)
return null;