diff options
author | Jan-Fabian Humann <j.f.humann@gmail.com> | 2014-03-08 19:26:32 +0100 |
---|---|---|
committer | Jan-Fabian Humann <j.f.humann@gmail.com> | 2014-03-08 19:26:32 +0100 |
commit | 72f9c8b06970cb351121ad1e02cccc268db8c56d (patch) | |
tree | e0f007678a3ff65ae252cadc6e752bf36bcf9998 /src/Protocol/Protocol17x.cpp | |
parent | Split cClientHandle::HandleEntityAction() into three seperate functions HandleEntityCrouch, HandleEntityLeaveBed and HandleEntitySprinting. (diff) | |
download | cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.tar cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.tar.gz cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.tar.bz2 cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.tar.lz cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.tar.xz cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.tar.zst cuberite-72f9c8b06970cb351121ad1e02cccc268db8c56d.zip |
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 19998a483..b0ec72a7d 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1733,25 +1733,23 @@ void cProtocol172::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer) HANDLE_READ(a_ByteBuffer, ReadByte, Byte, Action); HANDLE_READ(a_ByteBuffer, ReadBEInt, int, JumpBoost); - if (Action == 1) // Crouch + switch (Action) { + case 1: // Crouch m_Client->HandleEntityCrouch(PlayerID, true); - } - else if (Action == 2) // Uncrouch - { + break; + case 2: // Unchrouch m_Client->HandleEntityCrouch(PlayerID, false); - } - else if (Action == 3) // Leave Bed - { + break; + case 3: // Leave Bed m_Client->HandleEntityLeaveBed(PlayerID); - } - else if (Action == 4) // Start sprinting - { + break; + case 4: // Start sprinting m_Client->HandleEntitySprinting(PlayerID, true); - } - else if (Action == 5) // Stop sprinting - { + break; + case 5: // Stop sprinting m_Client->HandleEntitySprinting(PlayerID, false); + break; } } |