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/Protocol125.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/Protocol125.cpp')
-rw-r--r-- | src/Protocol/Protocol125.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp index 556ed1d08..169ab0c85 100644 --- a/src/Protocol/Protocol125.cpp +++ b/src/Protocol/Protocol125.cpp @@ -1376,25 +1376,23 @@ int cProtocol125::ParseEntityAction(void) HANDLE_PACKET_READ(ReadBEInt, int, EntityID); HANDLE_PACKET_READ(ReadChar, char, ActionID); - if (ActionID == 1) // Crouch + switch (ActionID) { + case 1: // Crouch m_Client->HandleEntityCrouch(EntityID, true); - } - else if (ActionID == 2) // Uncrouch - { + break; + case 2: // Uncrouch m_Client->HandleEntityCrouch(EntityID, false); - } - else if (ActionID == 3) // Leave Bed - { + break; + case 3: // Leave Bed m_Client->HandleEntityLeaveBed(EntityID); - } - else if (ActionID == 4) // Start sprinting - { + break; + case 4: // Start sprinting m_Client->HandleEntitySprinting(EntityID, true); - } - else if (ActionID == 5) // Stop sprinting - { + break; + case 5: // Stop sprinting m_Client->HandleEntitySprinting(EntityID, false); + break; } return PARSE_OK; |