Core/SpellScripts: Added helper method to validate spells
(cherry picked from commit 2b5d7eef3a091e67c27e853d43ac0bebbfa67531)
This commit is contained in:
1 parent
f46d0564fe
commit
cf2150047a
2 files changed
+14
No files matched your search
@@ -18,6 +18,7 @@
|
||||
#include "Spell.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellMgr.h"
|
||||
#include <string>
|
||||
@@ -32,6 +33,17 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _SpellScript::ValidateSpellInfo(std::vector<uint32> spellIds)
|
||||
{
|
||||
for (uint32 spellId : spellIds)
|
||||
if (!sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void _SpellScript::_Register()
|
||||
{
|
||||
m_currentScriptState = SPELL_SCRIPT_STATE_REGISTRATION;
|
||||
|
||||
Reference in new issue
Block a user