summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-12-15 15:11:59 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-12-15 15:11:59 +0100
commitffb5a69a9e1e531cb8effc72d2a2ad0a459981e3 (patch)
treef5781bbf67e56ba1bc91ec213812524addbc2e6a /src/Protocol/Protocol17x.cpp
parentExported Set and Get functions to Lua. (diff)
downloadcuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.tar
cuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.tar.gz
cuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.tar.bz2
cuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.tar.lz
cuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.tar.xz
cuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.tar.zst
cuberite-ffb5a69a9e1e531cb8effc72d2a2ad0a459981e3.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol17x.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 9b2b19026..edf7d2529 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1286,7 +1286,25 @@ void cProtocol172::HandlePacketPlayerAbilities(cByteBuffer & a_ByteBuffer)
HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Flags);
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, FlyingSpeed);
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, WalkingSpeed);
- m_Client->HandlePlayerAbilities(Flags, FlyingSpeed, WalkingSpeed);
+
+ bool IsFlying, CanFly;
+ if ((Flags & 2) != 0)
+ {
+ IsFlying = true;
+ }
+ else
+ {
+ IsFlying = false;
+ }
+ if ((Flags & 4) != 0)
+ {
+ CanFly = true;
+ }
+ else
+ {
+ CanFly = false;
+ }
+ m_Client->HandlePlayerAbilities(CanFly, IsFlying, FlyingSpeed, WalkingSpeed);
}