*Fix the bug that Eye of Acherus does not fly in some servers.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-21 02:46:48 -05:00
parent f8bec55205
commit 457f7971de
4 changed files with 27 additions and 4 deletions
+7
View File
@@ -20199,6 +20199,13 @@ void Player::SetClientControl(Unit* target, uint8 allowMove)
GetSession()->SendPacket(&data);
if(target == this)
SetMover(this);
else if(target->canFly())
{
WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12);
data.append(target->GetPackGUID());
data << uint32(0);
SendDirectMessage(&data);
}
}
void Player::UpdateZoneDependentAuras( uint32 newZone )
+7 -2
View File
@@ -5454,7 +5454,9 @@ void AuraEffect::HandleAuraAllowFlight(bool apply, bool Real, bool /*changeAmoun
if(m_target->GetTypeId() == TYPEID_UNIT)
m_target->SetFlying(apply);
if(Player *plr = m_target->GetMoverSource())
{
// allow fly
WorldPacket data;
if(apply)
@@ -5463,7 +5465,10 @@ void AuraEffect::HandleAuraAllowFlight(bool apply, bool Real, bool /*changeAmoun
data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(m_target->GetPackGUID());
data << uint32(0); // unk
m_target->SendMessageToSet(&data, true);
plr->SendDirectMessage(&data);
}
//m_target->SendMessageToSet(&data, true);
}
void AuraEffect::HandleModRating(bool apply, bool Real, bool changeAmount)
+12 -2
View File
@@ -8860,6 +8860,16 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
return nearMembers[randTarget];
}
Player * Unit::GetMoverSource() const
{
if(GetTypeId() == TYPEID_PLAYER && ((Player*)this)->m_mover == this)
return (Player*)this;
if(Unit *charmer = GetCharmer())
if(charmer->GetTypeId() == TYPEID_PLAYER && ((Player*)charmer)->m_mover == this)
return (Player*)charmer;
return NULL;
}
//only called in Player::SetSeer
void Unit::AddPlayerToVision(Player* plr)
{
@@ -14725,12 +14735,12 @@ void Unit::SetFlying(bool apply)
if(apply)
{
SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE + MOVEMENTFLAG_FLYING);
}
else
{
RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02);
RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING);
RemoveUnitMovementFlag(MOVEMENTFLAG_FLY_MODE + MOVEMENTFLAG_FLYING);
}
}
+1
View File
@@ -1431,6 +1431,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
CharmInfo* InitCharmInfo();
void DeleteCharmInfo();
void UpdateCharmAI();
Player * GetMoverSource() const;
SharedVisionList const& GetSharedVisionList() { return m_sharedVision; }
void AddPlayerToVision(Player* plr);
void RemovePlayerFromVision(Player* plr);