diff options
author | Jan-Fabian Humann <j.f.humann@gmail.com> | 2014-03-08 17:55:53 +0100 |
---|---|---|
committer | Jan-Fabian Humann <j.f.humann@gmail.com> | 2014-03-08 17:55:53 +0100 |
commit | 66970fe943ccc414c2f4fb722852f0461b8ddca2 (patch) | |
tree | ed732e738fe70cc71898c42993a7adccb39f08c1 /src/Protocol | |
parent | Merge pull request #764 from xdot/master (diff) | |
download | cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.tar cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.tar.gz cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.tar.bz2 cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.tar.lz cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.tar.xz cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.tar.zst cuberite-66970fe943ccc414c2f4fb722852f0461b8ddca2.zip |
Diffstat (limited to 'src/Protocol')
-rw-r--r-- | src/Protocol/Protocol125.cpp | 23 | ||||
-rw-r--r-- | src/Protocol/Protocol16x.cpp | 23 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 22 |
3 files changed, 65 insertions, 3 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp index 3980350f5..556ed1d08 100644 --- a/src/Protocol/Protocol125.cpp +++ b/src/Protocol/Protocol125.cpp @@ -1375,7 +1375,28 @@ int cProtocol125::ParseEntityAction(void) { HANDLE_PACKET_READ(ReadBEInt, int, EntityID); HANDLE_PACKET_READ(ReadChar, char, ActionID); - m_Client->HandleEntityAction(EntityID, ActionID); + + if (ActionID == 1) // Crouch + { + m_Client->HandleEntityCrouch(EntityID, true); + } + else if (ActionID == 2) // Uncrouch + { + m_Client->HandleEntityCrouch(EntityID, false); + } + else if (ActionID == 3) // Leave Bed + { + m_Client->HandleEntityLeaveBed(EntityID); + } + else if (ActionID == 4) // Start sprinting + { + m_Client->HandleEntitySprinting(EntityID, true); + } + else if (ActionID == 5) // Stop sprinting + { + m_Client->HandleEntitySprinting(EntityID, false); + } + return PARSE_OK; } diff --git a/src/Protocol/Protocol16x.cpp b/src/Protocol/Protocol16x.cpp index cfa27b3c4..6a41a577f 100644 --- a/src/Protocol/Protocol16x.cpp +++ b/src/Protocol/Protocol16x.cpp @@ -184,7 +184,28 @@ int cProtocol161::ParseEntityAction(void) HANDLE_PACKET_READ(ReadBEInt, int, EntityID); HANDLE_PACKET_READ(ReadChar, char, ActionID); HANDLE_PACKET_READ(ReadBEInt, int, UnknownHorseVal); - m_Client->HandleEntityAction(EntityID, ActionID); + + if (ActionID == 1) // Crouch + { + m_Client->HandleEntityCrouch(EntityID, true); + } + else if (ActionID == 2) // Uncrouch + { + m_Client->HandleEntityCrouch(EntityID, false); + } + else if (ActionID == 3) // Leave Bed + { + m_Client->HandleEntityLeaveBed(EntityID); + } + else if (ActionID == 4) // Start sprinting + { + m_Client->HandleEntitySprinting(EntityID, true); + } + else if (ActionID == 5) // Stop sprinting + { + m_Client->HandleEntitySprinting(EntityID, false); + } + return PARSE_OK; } diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 18646254f..19998a483 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1732,7 +1732,27 @@ void cProtocol172::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer) HANDLE_READ(a_ByteBuffer, ReadBEInt, int, PlayerID); HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Action); HANDLE_READ(a_ByteBuffer, ReadBEInt, int, JumpBoost); - m_Client->HandleEntityAction(PlayerID, Action); + + if (Action == 1) // Crouch + { + m_Client->HandleEntityCrouch(PlayerID, true); + } + else if (Action == 2) // Uncrouch + { + m_Client->HandleEntityCrouch(PlayerID, false); + } + else if (Action == 3) // Leave Bed + { + m_Client->HandleEntityLeaveBed(PlayerID); + } + else if (Action == 4) // Start sprinting + { + m_Client->HandleEntitySprinting(PlayerID, true); + } + else if (Action == 5) // Stop sprinting + { + m_Client->HandleEntitySprinting(PlayerID, false); + } } |