diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 9efbdb1f15..be545edf87 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -33,14 +33,17 @@ bool _SpellScript::_Validate(SpellInfo const* entry) return true; } -bool _SpellScript::ValidateSpellInfo(std::vector spellIds) +bool _SpellScript::ValidateSpellInfo(std::vector const& spellIds) { for (uint32 spellId : spellIds) + { if (!sSpellMgr->GetSpellInfo(spellId)) { TC_LOG_ERROR("scripts.spells", "_SpellScript::ValidateSpellInfo: Spell %u does not exist.", spellId); return false; } + } + return true; } diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 16eb161cc4..7b9bbffc94 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -133,7 +133,7 @@ class TC_GAME_API _SpellScript // use for: deallocating memory allocated by script virtual void Unload() { } // Helpers - static bool ValidateSpellInfo(std::vector spellIds); + static bool ValidateSpellInfo(std::vector const& spellIds); }; // SpellScript interface - enum used for runtime checks of script function calls