Core/Spells: Cleanup spell effects

Port From (https://github.com/TrinityCore/TrinityCore/commit/8a4e1119ac21e2d1112d1717337597fe073e495f)
This commit is contained in:
hondacrx
2021-09-08 17:40:50 -04:00
parent 2af5cad79f
commit 5c4a7511ff
41 changed files with 2378 additions and 1987 deletions
+2 -3
View File
@@ -4175,14 +4175,13 @@ namespace Game.Achievements
criteria.Id, criteria.Entry.Type, DataType, Aura.SpellId);
return false;
}
SpellEffectInfo effect = spellEntry.GetEffect(Aura.EffectIndex);
if (effect == null)
if (spellEntry.GetEffects().Count <= Aura.EffectIndex)
{
Log.outError(LogFilter.Sql, "Table `criteria_data` (Entry: {0} Type: {1}) for data type {2} has wrong spell effect index in value2 ({3}), ignored.",
criteria.Id, criteria.Entry.Type, DataType, Aura.EffectIndex);
return false;
}
if (effect.ApplyAuraName == 0)
if (spellEntry.GetEffect(Aura.EffectIndex).ApplyAuraName == 0)
{
Log.outError(LogFilter.Sql, "Table `criteria_data` (Entry: {0} Type: {1}) for data type {2} has non-aura spell effect (ID: {3} Effect: {4}), ignores.",
criteria.Id, criteria.Entry.Type, DataType, Aura.SpellId, Aura.EffectIndex);