diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 937dfb425..847edbb52 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2053,17 +2053,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real) // AT REMOVE else { - if (target->GetTypeId() == TYPEID_PLAYER && - (GetSpellProto()->Effect[EFFECT_INDEX_0] == 72 || GetSpellProto()->Effect[EFFECT_INDEX_0] == 6 && - (GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 1 || GetSpellProto()->EffectApplyAuraName[EFFECT_INDEX_0] == 128))) - { - // spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425 - ((Player*)target)->GetCamera().ResetView(); - WorldPacket data(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, 0); - ((Player*)target)->GetSession()->SendPacket(&data); - return; - } - if (IsQuestTameSpell(GetId()) && target->isAlive()) { Unit* caster = GetCaster(); @@ -3311,13 +3300,14 @@ void Aura::HandleModPossess(bool apply, bool Real) target->addUnitState(UNIT_STAT_CONTROLLED); target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); - target->SetCharmerGUID(p_caster->GetGUID()); target->setFaction(p_caster->getFaction()); - p_caster->SetCharm(target); - + // target should became visible at SetView call(if not visible before): + // otherwise client\p_caster will ignore packets from the target(SetClientControl for example) camera.SetView(target); + + p_caster->SetCharm(target); p_caster->SetClientControl(target, 1); p_caster->SetMover(target); @@ -3348,10 +3338,13 @@ void Aura::HandleModPossess(bool apply, bool Real) { p_caster->SetCharm(NULL); - camera.ResetView(); p_caster->SetClientControl(target, 0); p_caster->SetMover(NULL); + // there is a possibility that target became invisible for client\p_caster at ResetView call: + // it must be called after movement control unapplying, not before! the reason is same as at aura applying + camera.ResetView(); + p_caster->RemovePetActionBar(); // on delete only do caster related effects @@ -3410,7 +3403,10 @@ void Aura::HandleModPossessPet(bool apply, bool Real) { target->addUnitState(UNIT_STAT_CONTROLLED); + // target should became visible at SetView call(if not visible before): + // otherwise client\p_caster will ignore packets from the target(SetClientControl for example) camera.SetView(pet); + p_caster->SetCharm(pet); p_caster->SetClientControl(pet, 1); ((Player*)caster)->SetMover(pet); @@ -3423,11 +3419,14 @@ void Aura::HandleModPossessPet(bool apply, bool Real) } else { - camera.ResetView(); p_caster->SetCharm(NULL); p_caster->SetClientControl(pet, 0); p_caster->SetMover(NULL); + // there is a possibility that target became invisible for client\p_caster at ResetView call: + // it must be called after movement control unapplying, not before! the reason is same as at aura applying + camera.ResetView(); + // on delete only do caster related effects if(m_removeMode == AURA_REMOVE_BY_DELETE) return; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8cae3a36e..199388899 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 "10199" + #define REVISION_NR "10200" #endif // __REVISION_NR_H__