mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/Spell): Implement ValidateSpellInfo (#4323)
* feat(Core/Spell): Implement ValidateSpellInfo * cherry-pick from2b5d7eef3a&a0a158b5b8* sLog->outError * cleanup * convert to ValidateSpellInfo * fix error log * improve sLog->outError * remove non related spells stuff from Validate * remove the last * build * build x2
This commit is contained in:
@@ -14,12 +14,28 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
|
||||
{
|
||||
if (!Validate(entry))
|
||||
{
|
||||
sLog->outError("TSCR: Spell `%u` did not pass Validate() function of script `%s` - script will be not added to the spell", entry->Id, m_scriptName->c_str());
|
||||
sLog->outError("_SpellScript::_Validate: Spell `%u` did not pass Validate() function of script `%s` - script will not be added to the spell", entry->Id, m_scriptName->c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _SpellScript::_ValidateSpellInfo(uint32 const* begin, uint32 const* end)
|
||||
{
|
||||
bool allValid = true;
|
||||
while (begin != end)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(*begin))
|
||||
{
|
||||
sLog->outError("_SpellScript::_ValidateSpellInfo: Spell %u does not exist.", *begin);
|
||||
allValid = false;
|
||||
}
|
||||
|
||||
++begin;
|
||||
}
|
||||
return allValid;
|
||||
}
|
||||
|
||||
void _SpellScript::_Register()
|
||||
{
|
||||
m_currentScriptState = SPELL_SCRIPT_STATE_REGISTRATION;
|
||||
|
||||
Reference in New Issue
Block a user