aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellScript.cpp5
-rw-r--r--src/server/game/Spells/SpellScript.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index c56fb6ce0ef..32aad8a11ed 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<uint32> spellIds)
+bool _SpellScript::ValidateSpellInfo(std::vector<uint32> 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 51d3c2a85ab..330727cdc1e 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<uint32> spellIds);
+ static bool ValidateSpellInfo(std::vector<uint32> const& spellIds);
};
// SpellScript interface - enum used for runtime checks of script function calls