diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-05-28 16:34:44 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-05-28 16:34:44 +0200 |
commit | a0a158b5b851db7e2c16819ec89e913d914a3aba (patch) | |
tree | e2170b14fe7bba2bf70c30500eb129c6eadc2c20 /src/server/game/Spells/SpellScript.cpp | |
parent | d427fed13b49aec1722544b3ca72a0a41160bbe3 (diff) |
Core/Scripts: Include cleanup
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index a450751df2d..c96086f89ce 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -34,15 +34,19 @@ bool _SpellScript::_Validate(SpellInfo const* entry) return true; } -bool _SpellScript::ValidateSpellInfo(std::vector<uint32> spellIds) +bool _SpellScript::_ValidateSpellInfo(uint32 const* begin, uint32 const* end) { - for (uint32 spellId : spellIds) - if (!sSpellMgr->GetSpellInfo(spellId)) + bool allValid = true; + while (begin != end) + { + if (!sSpellMgr->GetSpellInfo(*begin)) { - TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId); - return false; + TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", *begin); + allValid = false; } - return true; + ++begin; + } + return allValid; } void _SpellScript::_Register() |