summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 17:16:35 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 17:16:35 +0100
commit0e6107bfddeb6265f7a20076cdb86d5fa1aaa905 (patch)
treeabbc672f049128c6821b2f0c12cd49692bcaaf8f /src/Protocol/Protocol17x.cpp
parentfixed visual studio compile flags (diff)
parentMerge pull request #450 from mc-server/redstonefixes (diff)
downloadcuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.gz
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.bz2
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.lz
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.xz
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.zst
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.zip
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r--src/Protocol/Protocol17x.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index fff5311f6..161e81936 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -490,6 +490,7 @@ void cProtocol172::SendPlayerAbilities(void)
if (m_Client->GetPlayer()->IsGameModeCreative())
{
Flags |= 0x01;
+ Flags |= 0x08; // Godmode, used for creative
}
if (m_Client->GetPlayer()->IsFlying())
{
@@ -499,7 +500,6 @@ void cProtocol172::SendPlayerAbilities(void)
{
Flags |= 0x04;
}
- // TODO: Other flags (god mode)
Pkt.WriteByte(Flags);
// TODO: Pkt.WriteFloat(m_Client->GetPlayer()->GetMaxFlyingSpeed());
Pkt.WriteFloat(0.05f);
@@ -1291,23 +1291,16 @@ void cProtocol172::HandlePacketPlayerAbilities(cByteBuffer & a_ByteBuffer)
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, FlyingSpeed);
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, WalkingSpeed);
- bool IsFlying, CanFly;
+ bool IsFlying = false, CanFly = false;
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);
}