feat(Core/Spell): Implement ValidateSpellInfo

* Cherry-pick from 2b5d7eef3a & a0a158b5b8
This commit is contained in:
Kitzunu
2021-01-21 20:49:05 +01:00
parent 7ddecfb4b3
commit 7690f02b49
2 changed files with 30 additions and 0 deletions

View File

@@ -110,6 +110,20 @@ public:
// Function called when script is destroyed
// use for: deallocating memory allocated by script
virtual void Unload() {}
// Helpers
static bool ValidateSpellInfo(std::initializer_list<uint32> spellIds)
{
return _ValidateSpellInfo(spellIds.begin(), spellIds.end());
}
template <class T>
static bool ValidateSpellInfo(T const& spellIds)
{
return _ValidateSpellInfo(std::begin(spellIds), std::end(spellIds));
}
private:
static bool _ValidateSpellInfo(uint32 const* begin, uint32 const* end);
};
// SpellScript interface - enum used for runtime checks of script function calls