diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 735e4ad36..1d673bf83 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3621,7 +3621,7 @@ void Spell::EffectSummonGuardian(uint32 i) // FIXME: some guardians have control spell applied and controlled by player and anyway player can't summon in this time // so this code hack in fact if( m_caster->GetTypeId() == TYPEID_PLAYER && (duration <= 0 || GetSpellRecoveryTime(m_spellInfo) == 0) ) - if(((Player*)m_caster)->HasGuardianWithEntry(pet_entry)) + if(m_caster->FindGuardianWithEntry(pet_entry)) return; // find old guardian, ignore summon // in another case summon new @@ -6584,4 +6584,4 @@ void Spell::EffectRenamePet(uint32 /*eff_idx*/) return; unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED); -} \ No newline at end of file +} diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 43f8cd781..cb67d009e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7584,7 +7584,7 @@ void Unit::RemoveGuardians() } } -bool Unit::HasGuardianWithEntry(uint32 entry) +Pet* Unit::FindGuardianWithEntry(uint32 entry) { // pet guid middle part is entry (and creature also) // and in guardian list must be guardians with same entry _always_ @@ -7592,10 +7592,10 @@ bool Unit::HasGuardianWithEntry(uint32 entry) { if(Pet* pet = ObjectAccessor::GetPet(*itr)) if (pet->GetEntry() == entry) - return true; + return pet; } - return false; + return NULL; } void Unit::UnsummonAllTotems() diff --git a/src/game/Unit.h b/src/game/Unit.h index 5dc6d3f8b..8e5e8bea3 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1196,7 +1196,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void AddGuardian(Pet* pet); void RemoveGuardian(Pet* pet); void RemoveGuardians(); - bool HasGuardianWithEntry(uint32 entry); + Pet* FindGuardianWithEntry(uint32 entry); bool isCharmed() const { return GetCharmerGUID() != 0; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 857b8f584..f0a60a160 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 "8034" + #define REVISION_NR "8035" #endif // __REVISION_NR_H__