Core/Movement: Knockback Effect on Flying Mount

by @robinsch; closes #6099

Keep the mounted player flying after the knockback effect cast on mounted player.

Before these changes, the flying mount behaves like a ground mount after the knockback.
From large enough heights, the fall causes damage or death to the falling (mounted) character.
This commit is contained in:
robinsch authored and tkrokli committed 2015-06-02 04:26:40 +02:00
1 parent 833a0d2ea5
commit 81111116fa
6 files changed
+11 -8

No files matched your search

+5 -2
View File
@@ -16448,7 +16448,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
float vcos, vsin;
GetSinCos(x, y, vsin, vcos);
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4));
WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8 + 4 + 4 + 4 + 4 + 4));
data << GetPackGUID();
data << uint32(0); // counter
data << float(vcos); // x direction
@@ -16457,6 +16457,9 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
data << float(-speedZ); // Z Movement speed (vertical)
player->GetSession()->SendPacket(&data);
if (player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) || player->HasAuraType(SPELL_AURA_FLY))
player->SetCanFly(true, true);
}
}
@@ -17515,7 +17518,7 @@ bool Unit::SetSwim(bool enable)
return true;
}
bool Unit::SetCanFly(bool enable)
bool Unit::SetCanFly(bool enable, bool /*packetOnly = false */)
{
if (enable == HasUnitMovementFlag(MOVEMENTFLAG_CAN_FLY))
return false;