1
0
Fork 0

Ignore CanFly flag sent by the client

This commit is contained in:
mathiascode 2020-12-13 21:21:50 +02:00 committed by Tiger Wang
parent 090d8305e4
commit 2103308618
3 changed files with 4 additions and 9 deletions

View File

@ -837,12 +837,11 @@ void cClientHandle::HandleEnchantItem(UInt8 a_WindowID, UInt8 a_Enchantment)
void cClientHandle::HandlePlayerAbilities(bool a_CanFly, bool a_IsFlying, float FlyingSpeed, float WalkingSpeed)
void cClientHandle::HandlePlayerAbilities(bool a_IsFlying, float FlyingSpeed, float WalkingSpeed)
{
UNUSED(FlyingSpeed); // Ignore the client values for these
UNUSED(WalkingSpeed);
m_Player->SetCanFly(a_CanFly);
m_Player->SetFlying(a_IsFlying);
}

View File

@ -350,7 +350,7 @@ public: // tolua_export
void HandleOpenHorseInventory(UInt32 a_EntityID);
void HandlePing (void);
void HandlePlayerAbilities (bool a_CanFly, bool a_IsFlying, float FlyingSpeed, float WalkingSpeed);
void HandlePlayerAbilities (bool a_IsFlying, float FlyingSpeed, float WalkingSpeed);
void HandlePlayerLook (float a_Rotation, float a_Pitch, bool a_IsOnGround);
void HandlePlayerMoveLook (double a_PosX, double a_PosY, double a_PosZ, double a_Stance, float a_Rotation, float a_Pitch, bool a_IsOnGround); // While m_bPositionConfirmed (normal gameplay)

View File

@ -2641,17 +2641,13 @@ void cProtocol_1_8_0::HandlePacketPlayerAbilities(cByteBuffer & a_ByteBuffer)
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, WalkingSpeed);
// COnvert the bitfield into individual boolean flags:
bool IsFlying = false, CanFly = false;
bool IsFlying = false;
if ((Flags & 2) != 0)
{
IsFlying = true;
}
if ((Flags & 4) != 0)
{
CanFly = true;
}
m_Client->HandlePlayerAbilities(CanFly, IsFlying, FlyingSpeed, WalkingSpeed);
m_Client->HandlePlayerAbilities(IsFlying, FlyingSpeed, WalkingSpeed);
}