diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Pet/Pet.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 6cc6d04543a..6890113178a 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1306,24 +1306,22 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel if (itr != m_spells.end()) { if (itr->second.state == PETSPELL_REMOVED) - { - m_spells.erase(itr); state = PETSPELL_CHANGED; - } - else if (state == PETSPELL_UNCHANGED && itr->second.state != PETSPELL_UNCHANGED) + else { - // can be in case spell loading but learned at some previous spell loading - itr->second.state = PETSPELL_UNCHANGED; + if (state == PETSPELL_UNCHANGED && itr->second.state != PETSPELL_UNCHANGED) + { + // can be in case spell loading but learned at some previous spell loading + itr->second.state = PETSPELL_UNCHANGED; - if (active == ACT_ENABLED) - ToggleAutocast(spellInfo, true); - else if (active == ACT_DISABLED) - ToggleAutocast(spellInfo, false); + if (active == ACT_ENABLED) + ToggleAutocast(spellInfo, true); + else if (active == ACT_DISABLED) + ToggleAutocast(spellInfo, false); + } return false; } - else - return false; } PetSpell newspell; |