summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 17:16:35 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 17:16:35 +0100
commit0e6107bfddeb6265f7a20076cdb86d5fa1aaa905 (patch)
treeabbc672f049128c6821b2f0c12cd49692bcaaf8f /src/ClientHandle.cpp
parentfixed visual studio compile flags (diff)
parentMerge pull request #450 from mc-server/redstonefixes (diff)
downloadcuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.gz
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.bz2
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.lz
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.xz
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.tar.zst
cuberite-0e6107bfddeb6265f7a20076cdb86d5fa1aaa905.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 9550e3afe..837f88e61 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -264,9 +264,6 @@ void cClientHandle::Authenticate(void)
// Send experience
m_Player->SendExperience();
- // Send gamemode (1.6.1 movementSpeed):
- SendGameMode(m_Player->GetGameMode());
-
m_Player->Initialize(World);
m_State = csAuthenticated;
@@ -489,6 +486,9 @@ void cClientHandle::HandleCreativeInventory(short a_SlotNum, const cItem & a_Hel
void cClientHandle::HandlePlayerAbilities(bool a_CanFly, bool a_IsFlying, float FlyingSpeed, float WalkingSpeed)
{
+ UNUSED(FlyingSpeed); // Ignore the client values for these
+ UNUSED(WalkingSpeed);
+
m_Player->SetCanFly(a_CanFly);
m_Player->SetFlying(a_IsFlying);
}
@@ -1065,7 +1065,29 @@ void cClientHandle::HandleAnimation(char a_Animation)
// Plugin disagrees, bail out
return;
}
-
+
+ // Because the animation ID sent to servers by clients are different to those sent back, we need this
+ switch (a_Animation)
+ {
+ case 0: // No animation - wiki.vg doesn't say that client has something specific for it, so I suppose it will just become -1
+ case 1:
+ case 2:
+ case 3:
+ {
+ a_Animation--; // Offset by -1
+ break;
+ }
+ case 5:
+ case 6:
+ case 7:
+ {
+ a_Animation -= 2; // Offset by -2
+ break;
+ }
+ default: // Anything else is the same
+ break;
+ }
+
m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this);
}