diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-03-19 17:29:13 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2018-03-19 17:29:13 -0300 |
commit | 3670779e8eb07c05f77e61e09486d85d7210e4ed (patch) | |
tree | eac95a9c508b5d55aa339ba46fe38178a8ae44d5 | |
parent | d88b50a6ad5240b138559318d8c1c2dea3785090 (diff) |
Core/Creatures: Minor HasSpell method cleanup
Cherry-picked improved from 5734788c0277d7f342d534dca63db0ce4e862bc5
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 1bd64266f4c..7d7c1ae6f4d 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2586,11 +2586,7 @@ uint32 Creature::GetShieldBlockValue() const //dunno mob block bool Creature::HasSpell(uint32 spellID) const { - uint8 i; - for (i = 0; i < MAX_CREATURE_SPELLS; ++i) - if (spellID == m_spells[i]) - break; - return i < MAX_CREATURE_SPELLS; //broke before end of iteration of known spells + return std::find(std::begin(m_spells), std::end(m_spells), spellID) != std::end(m_spells); } time_t Creature::GetRespawnTimeEx() const |