Core/Movement: Fix players still able to fly on SPELL_AURA_FLY and SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED unapply.
Closes #5731
This commit is contained in:
@@ -2844,21 +2844,14 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
|
||||
return;
|
||||
}
|
||||
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->SetCanFly(apply);
|
||||
//! Not entirely sure if this should be sent for creatures as well, but I don't think so.
|
||||
target->SetCanFly(apply);
|
||||
Player* player = target->ToPlayer();
|
||||
if (!player)
|
||||
player = target->m_movedPlayer;
|
||||
|
||||
if (Player* player = target->m_movedPlayer)
|
||||
{
|
||||
// allow flying
|
||||
WorldPacket data;
|
||||
if (apply)
|
||||
data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
|
||||
else
|
||||
data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
|
||||
data.append(target->GetPackGUID());
|
||||
data << uint32(0); // movement counter
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
if (player)
|
||||
player->SendMovementCanFlyChange();
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
@@ -3231,25 +3224,22 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
// Enable Fly mode for flying mounts
|
||||
//! Update ability to fly
|
||||
if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY))))
|
||||
{
|
||||
if (Player* player = target->m_movedPlayer)
|
||||
{
|
||||
WorldPacket data;
|
||||
if (apply)
|
||||
data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
|
||||
else
|
||||
data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
|
||||
data.append(player->GetPackGUID());
|
||||
data << uint32(0); // unknown
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
target->SetCanFly(apply);
|
||||
Player* player = target->ToPlayer();
|
||||
if (!player)
|
||||
player = target->m_movedPlayer;
|
||||
|
||||
if (player)
|
||||
player->SendMovementCanFlyChange();
|
||||
}
|
||||
|
||||
//! Someone should clean up these hacks and remove it from this function. It doesn't even belong here.
|
||||
if (mode & AURA_EFFECT_HANDLE_REAL)
|
||||
{
|
||||
//Players on flying mounts must be immune to polymorph
|
||||
|
||||
Reference in New Issue
Block a user