Core/Spells: Validate spell_proc.AttributesMask on startup

Port From (https://github.com/TrinityCore/TrinityCore/commit/415aaae7f2fa3a5e09a51b0355120bf4138cde41)
This commit is contained in:
hondacrx
2022-02-25 13:02:48 -05:00
parent 28175c47b1
commit b7cd5b11f2
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -1431,6 +1431,11 @@ namespace Game.Entities
if (!found)
Log.outError(LogFilter.Sql, $"The `spell_proc` table entry for spellId {spellInfo.Id} has Attribute PROC_ATTR_REQ_SPELLMOD, but spell has no spell mods. Proc will not be triggered");
}
if ((procEntry.AttributesMask & ~ProcAttributes.AllAllowed) != 0)
{
Log.outError(LogFilter.Sql, $"The `spell_proc` table entry for spellId {spellInfo.Id} has `AttributesMask` value specifying invalid attributes 0x{procEntry.AttributesMask & ~ProcAttributes.AllAllowed:X2}.");
procEntry.AttributesMask &= ProcAttributes.AllAllowed;
}
mSpellProcMap.Add((spellInfo.Id, spellInfo.Difficulty), procEntry);
++count;