From 53e8c067eabb7eb024c84bf0e2af9c81d30f2acd Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 19 Dec 2013 16:03:43 +0000 Subject: Fixed 1.7 arm swing animation --- src/ClientHandle.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 9565fc41f..de0a57a0a 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -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); } -- cgit v1.2.3 From 03a8dfc4a8daf2ef3ea63b1fdf161018acbe12ce Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 19 Dec 2013 20:53:47 +0000 Subject: Fixed PlayerAbilities and creative --- src/ClientHandle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index de0a57a0a..1e63e2ba1 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); } -- cgit v1.2.3