diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 58b87c5d1..a173c009e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4617,23 +4617,26 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction) PetType petType = propEntry->Title == UNITNAME_SUMMON_TITLE_COMPANION ? PROTECTOR_PET : GUARDIAN_PET; - // protectors allowed only in single amount - if (petType == PROTECTOR_PET) + // second cast unsummon guardian(s) (guardians without like functionality have cooldown > spawn time) + if (m_caster->GetTypeId() == TYPEID_PLAYER) { - Pet* old_protector = m_caster->GetProtectorPet(); - - // for same pet just despawn - if (old_protector && old_protector->GetEntry() == pet_entry) + bool found = false; + // including protector + while (Pet* old_summon = m_caster->FindGuardianWithEntry(pet_entry)) { - old_protector->Unsummon(PET_SAVE_AS_DELETED, m_caster); - return; + old_summon->Unsummon(PET_SAVE_AS_DELETED, m_caster); + found = true; } - // despawn old pet before summon new - if (old_protector) - old_protector->Unsummon(PET_SAVE_AS_DELETED, m_caster); + if (found) + return; } + // protectors allowed only in single amount + if (petType = PROTECTOR_PET) + if (Pet* old_protector = m_caster->GetProtectorPet()) + old_protector->Unsummon(PET_SAVE_AS_DELETED, m_caster); + // in another case summon new uint32 level = m_caster->getLevel(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 183d0c106..7bdaebe6c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10846" + #define REVISION_NR "10847" #endif // __REVISION_NR_H__