From f2f0aeb562dfc1a78b04d13a14e3c37a58367619 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 27 May 2021 15:51:58 +0200 Subject: Core/Scripts: Allow spell script ValidateSpellInfo to work with any container type --- src/server/game/Spells/SpellScript.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/server/game/Spells/SpellScript.cpp') diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 136b5a525b9..25cdb64d19f 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -35,20 +35,15 @@ bool _SpellScript::_Validate(SpellInfo const* entry) return true; } -bool _SpellScript::_ValidateSpellInfo(uint32 const* begin, uint32 const* end) +bool _SpellScript::_ValidateSpellInfo(uint32 spellId) { - bool allValid = true; - while (begin != end) + if (!sSpellMgr->GetSpellInfo(spellId)) { - if (!sSpellMgr->GetSpellInfo(*begin)) - { - TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", *begin); - allValid = false; - } - - ++begin; + TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId); + return false; } - return allValid; + + return true; } void _SpellScript::_Register() -- cgit v1.2.3