mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Spells: Validate spell_proc.AttributesMask on startup
This commit is contained in:
@@ -1626,6 +1626,11 @@ void SpellMgr::LoadSpellProcs()
|
||||
if (!found)
|
||||
TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has Attribute PROC_ATTR_REQ_SPELLMOD, but spell has no spell mods. Proc will not be triggered", spellInfo->Id);
|
||||
}
|
||||
if (procEntry.AttributesMask & ~PROC_ATTR_ALL_ALLOWED)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `AttributesMask` value specifying invalid attributes 0x%02X.", spellInfo->Id, procEntry.AttributesMask & ~PROC_ATTR_ALL_ALLOWED);
|
||||
procEntry.AttributesMask &= PROC_ATTR_ALL_ALLOWED;
|
||||
}
|
||||
|
||||
mSpellProcMap[{ spellInfo->Id, spellInfo->Difficulty }] = procEntry;
|
||||
|
||||
|
||||
@@ -272,6 +272,13 @@ enum ProcAttributes
|
||||
PROC_ATTR_REDUCE_PROC_60 = 0x0000080 // aura should have a reduced chance to proc if level of proc Actor > 60
|
||||
};
|
||||
|
||||
#define PROC_ATTR_ALL_ALLOWED (PROC_ATTR_REQ_EXP_OR_HONOR | \
|
||||
PROC_ATTR_TRIGGERED_CAN_PROC | \
|
||||
PROC_ATTR_REQ_POWER_COST | \
|
||||
PROC_ATTR_REQ_SPELLMOD | \
|
||||
PROC_ATTR_USE_STACKS_FOR_CHARGES | \
|
||||
PROC_ATTR_REDUCE_PROC_60)
|
||||
|
||||
struct SpellProcEntry
|
||||
{
|
||||
uint32 SchoolMask; // if nonzero - bitmask for matching proc condition based on spell's school
|
||||
|
||||
Reference in New Issue
Block a user