Core/Scripts: Allow spell script ValidateSpellInfo to work with any container type

(cherry picked from commit f2f0aeb562)
This commit is contained in:
Shauren
2021-05-27 15:51:58 +02:00
parent b5d46ec5ad
commit 86e7789160
2 changed files with 6 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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;
}