summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Fabian Humann <j.f.humann@gmail.com>2014-03-09 10:55:06 +0100
committerJan-Fabian Humann <j.f.humann@gmail.com>2014-03-09 10:55:06 +0100
commitf74ee8fb51c015f678438cc1dccf23d1d3c2cf6a (patch)
treed125925f49ad982dc663232e8da71d811e44a74f /src
parentChanged if-else to switch-case (diff)
downloadcuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.tar
cuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.tar.gz
cuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.tar.bz2
cuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.tar.lz
cuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.tar.xz
cuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.tar.zst
cuberite-f74ee8fb51c015f678438cc1dccf23d1d3c2cf6a.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol125.cpp20
-rw-r--r--src/Protocol/Protocol16x.cpp20
-rw-r--r--src/Protocol/Protocol17x.cpp20
3 files changed, 15 insertions, 45 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index 169ab0c85..ca286bafb 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -1378,21 +1378,11 @@ int cProtocol125::ParseEntityAction(void)
switch (ActionID)
{
- case 1: // Crouch
- m_Client->HandleEntityCrouch(EntityID, true);
- break;
- case 2: // Uncrouch
- m_Client->HandleEntityCrouch(EntityID, false);
- break;
- case 3: // Leave Bed
- m_Client->HandleEntityLeaveBed(EntityID);
- break;
- case 4: // Start sprinting
- m_Client->HandleEntitySprinting(EntityID, true);
- break;
- case 5: // Stop sprinting
- m_Client->HandleEntitySprinting(EntityID, false);
- break;
+ case 1: m_Client->HandleEntityCrouch(EntityID, true); break; // Crouch
+ case 2: m_Client->HandleEntityCrouch(EntityID, false); break; // Uncrouch
+ case 3: m_Client->HandleEntityLeaveBed(EntityID); break; // Leave Bed
+ case 4: m_Client->HandleEntitySprinting(EntityID, true); break; // Start sprinting
+ case 5: m_Client->HandleEntitySprinting(EntityID, false); break; // Stop sprinting
}
return PARSE_OK;
diff --git a/src/Protocol/Protocol16x.cpp b/src/Protocol/Protocol16x.cpp
index 4b1b4f408..f6ec0a199 100644
--- a/src/Protocol/Protocol16x.cpp
+++ b/src/Protocol/Protocol16x.cpp
@@ -187,21 +187,11 @@ int cProtocol161::ParseEntityAction(void)
switch (ActionID)
{
- case 1: // Crouch
- m_Client->HandleEntityCrouch(EntityID, true);
- break;
- case 2: // Uncrouch
- m_Client->HandleEntityCrouch(EntityID, false);
- break;
- case 3: // Leave Bed
- m_Client->HandleEntityLeaveBed(EntityID);
- break;
- case 4: // Start sprinting
- m_Client->HandleEntitySprinting(EntityID, true);
- break;
- case 5: // Stop sprinting
- m_Client->HandleEntitySprinting(EntityID, false);
- break;
+ case 1: m_Client->HandleEntityCrouch(EntityID, true); break; // Crouch
+ case 2: m_Client->HandleEntityCrouch(EntityID, false); break; // Uncrouch
+ case 3: m_Client->HandleEntityLeaveBed(EntityID); break; // Leave Bed
+ case 4: m_Client->HandleEntitySprinting(EntityID, true); break; // Start sprinting
+ case 5: m_Client->HandleEntitySprinting(EntityID, false); break; // Stop sprinting
}
return PARSE_OK;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index b0ec72a7d..0bb9a1204 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1735,21 +1735,11 @@ void cProtocol172::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer)
switch (Action)
{
- case 1: // Crouch
- m_Client->HandleEntityCrouch(PlayerID, true);
- break;
- case 2: // Unchrouch
- m_Client->HandleEntityCrouch(PlayerID, false);
- break;
- case 3: // Leave Bed
- m_Client->HandleEntityLeaveBed(PlayerID);
- break;
- case 4: // Start sprinting
- m_Client->HandleEntitySprinting(PlayerID, true);
- break;
- case 5: // Stop sprinting
- m_Client->HandleEntitySprinting(PlayerID, false);
- break;
+ case 1: m_Client->HandleEntityCrouch(PlayerID, true); break; // Crouch
+ case 2: m_Client->HandleEntityCrouch(PlayerID, false); break; // Uncrouch
+ case 3: m_Client->HandleEntityLeaveBed(PlayerID); break; // Leave Bed
+ case 4: m_Client->HandleEntitySprinting(PlayerID, true); break; // Start sprinting
+ case 5: m_Client->HandleEntitySprinting(PlayerID, false); break; // Stop sprinting
}
}