[8113] Fixed setting mover for Posses/Charm auras and Vehicle enter/exit.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
m4cm4n 2009-07-04 12:50:32 +02:00 committed by ApoC
parent d17a49f6dc
commit 7c5f254012
5 changed files with 7 additions and 4 deletions

View file

@ -19386,6 +19386,7 @@ void Player::EnterVehicle(Vehicle *vehicle)
SetFarSightGUID(vehicle->GetGUID()); // set view SetFarSightGUID(vehicle->GetGUID()); // set view
SetClientControl(vehicle, 1); // redirect controls to vehicle SetClientControl(vehicle, 1); // redirect controls to vehicle
SetMover(vehicle);
WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
@ -19437,6 +19438,7 @@ void Player::ExitVehicle(Vehicle *vehicle)
SetFarSightGUID(0); SetFarSightGUID(0);
SetClientControl(vehicle, 0); SetClientControl(vehicle, 0);
SetMover(NULL);
WorldPacket data(MSG_MOVE_TELEPORT_ACK, 30); WorldPacket data(MSG_MOVE_TELEPORT_ACK, 30);
data.append(GetPackGUID()); data.append(GetPackGUID());

View file

@ -2028,6 +2028,7 @@ class MANGOS_DLL_SPEC Player : public Unit
bool IsAllowUseFlyMountsHere() const; bool IsAllowUseFlyMountsHere() const;
void SetClientControl(Unit* target, uint8 allowMove); void SetClientControl(Unit* target, uint8 allowMove);
void SetMover(Unit* target) { m_mover = target ? target : this; }
void EnterVehicle(Vehicle *vehicle); void EnterVehicle(Vehicle *vehicle);
void ExitVehicle(Vehicle *vehicle); void ExitVehicle(Vehicle *vehicle);

View file

@ -3087,6 +3087,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
{ {
((Player*)caster)->SetFarSightGUID(m_target->GetGUID()); ((Player*)caster)->SetFarSightGUID(m_target->GetGUID());
((Player*)caster)->SetClientControl(m_target, 1); ((Player*)caster)->SetClientControl(m_target, 1);
((Player*)caster)->SetMover(m_target);
} }
m_target->CombatStop(); m_target->CombatStop();
@ -3130,6 +3131,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
{ {
((Player*)caster)->SetFarSightGUID(0); ((Player*)caster)->SetFarSightGUID(0);
((Player*)caster)->SetClientControl(m_target, 0); ((Player*)caster)->SetClientControl(m_target, 0);
((Player*)caster)->SetMover(NULL);
WorldPacket data(SMSG_PET_SPELLS, 8); WorldPacket data(SMSG_PET_SPELLS, 8);
data << uint64(0); data << uint64(0);
@ -3167,6 +3169,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
((Player*)caster)->SetFarSightGUID(apply ? pet->GetGUID() : 0); ((Player*)caster)->SetFarSightGUID(apply ? pet->GetGUID() : 0);
((Player*)caster)->SetCharm(apply ? pet : NULL); ((Player*)caster)->SetCharm(apply ? pet : NULL);
((Player*)caster)->SetClientControl(pet, apply ? 1 : 0); ((Player*)caster)->SetClientControl(pet, apply ? 1 : 0);
((Player*)caster)->SetMover(apply ? pet : NULL);
if(apply) if(apply)
{ {

View file

@ -7564,9 +7564,6 @@ void Unit::SetPet(Pet* pet)
void Unit::SetCharm(Unit* pet) void Unit::SetCharm(Unit* pet)
{ {
SetUInt64Value(UNIT_FIELD_CHARM, pet ? pet->GetGUID() : 0); SetUInt64Value(UNIT_FIELD_CHARM, pet ? pet->GetGUID() : 0);
if(GetTypeId() == TYPEID_PLAYER)
((Player*)this)->m_mover = pet ? pet : this;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8112" #define REVISION_NR "8113"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__