diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-01-24 23:38:46 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2017-01-24 23:38:46 -0300 |
commit | 6ca9f99aafb745f1c316daf168734230b76d161b (patch) | |
tree | 425ea8b65b8d37dac1d2750eb6e3b81c2720787e /src | |
parent | 2c20b368bc05bd58b5a77825dc2c8083386ad6c4 (diff) |
Core/SpellScript: Pass vector to ValidateSpellInfo by reference
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 5 | ||||
-rw-r--r-- | src/server/game/Spells/SpellScript.h | 2 |
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 |