mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripts: Allow spell script ValidateSpellInfo to work with any container type
(cherry picked from commit f2f0aeb562)
This commit is contained in:
@@ -48,6 +48,7 @@ bool _SpellScript::_ValidateSpellInfo(uint32 spellId)
|
||||
TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,16 +178,16 @@ class TC_GAME_API _SpellScript
|
||||
}
|
||||
|
||||
private:
|
||||
template <class InputIt>
|
||||
static bool _ValidateSpellInfo(InputIt first, InputIt last)
|
||||
template<typename Iterator>
|
||||
static bool _ValidateSpellInfo(Iterator begin, Iterator end)
|
||||
{
|
||||
bool allValid = true;
|
||||
while (first != last)
|
||||
while (begin != end)
|
||||
{
|
||||
if (!_ValidateSpellInfo(*first))
|
||||
if (!_ValidateSpellInfo(*begin))
|
||||
allValid = false;
|
||||
|
||||
++first;
|
||||
++begin;
|
||||
}
|
||||
return allValid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user