summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormathiascode <mail@mathias.is>2020-12-13 20:21:50 +0100
committerTiger Wang <ziwei.tiger@outlook.com>2020-12-18 22:03:50 +0100
commit21033086187bfb535200a04c2d1bcb867f9195db (patch)
treedabdda64b5a813f1dd75e8411c5431caec14df70 /src
parentWarnings improvements (diff)
downloadcuberite-21033086187bfb535200a04c2d1bcb867f9195db.tar
cuberite-21033086187bfb535200a04c2d1bcb867f9195db.tar.gz
cuberite-21033086187bfb535200a04c2d1bcb867f9195db.tar.bz2
cuberite-21033086187bfb535200a04c2d1bcb867f9195db.tar.lz
cuberite-21033086187bfb535200a04c2d1bcb867f9195db.tar.xz
cuberite-21033086187bfb535200a04c2d1bcb867f9195db.tar.zst
cuberite-21033086187bfb535200a04c2d1bcb867f9195db.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp3
-rw-r--r--src/ClientHandle.h2
-rw-r--r--src/Protocol/Protocol_1_8.cpp8
3 files changed, 4 insertions, 9 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 88746f273..cee35203e 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -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);
}
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 33a9a8f8c..fcad949f4 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -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)
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 49418b475..d9d18b41a 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -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);
}