mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
fix(Core/Spell): Add additional check to LoadSpellScripts() (#7860)
This commit is contained in:
@@ -5132,10 +5132,15 @@ void ObjectMgr::LoadSpellScripts()
|
||||
continue;
|
||||
}
|
||||
|
||||
uint8 i = (uint8)((uint32(itr->first) >> 24) & 0x000000FF);
|
||||
SpellEffIndex i = SpellEffIndex((uint32(itr->first) >> 24) & 0x000000FF);
|
||||
if (uint32(i) >= MAX_SPELL_EFFECTS)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Table `spell_scripts` has too high effect index %u for spell (Id: %u) as script id", uint32(i), spellId);
|
||||
}
|
||||
|
||||
//check for correct spellEffect
|
||||
if (!spellInfo->Effects[i].Effect || (spellInfo->Effects[i].Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->Effects[i].Effect != SPELL_EFFECT_DUMMY))
|
||||
LOG_ERROR("sql.sql", "Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i);
|
||||
LOG_ERROR("sql.sql", "Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, uint32(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user