summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol17x.cpp24
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;
}
}