From dff77e8e5690b7834652884aadf6c3d5e1ceafd9 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 4 Jun 2013 14:18:03 +0000 Subject: Implemented proper player crouching. Fixes FS #365 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1553 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ClientHandle.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'source/ClientHandle.cpp') diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp index a57e71374..0eb24e9e9 100644 --- a/source/ClientHandle.cpp +++ b/source/ClientHandle.cpp @@ -1170,9 +1170,23 @@ void cClientHandle::HandleEntityAction(int a_EntityID, char a_ActionID) return; } - if( a_ActionID == 3 ) // Leave bed + switch (a_ActionID) { - m_Player->GetWorld()->BroadcastPlayerAnimation( *m_Player, 3 ); + case 1: // crouch + { + m_Player->SetCrouch(true); + break; + } + case 2: // uncrouch + { + m_Player->SetCrouch(false); + break; + } + case 3: // Leave bed + { + m_Player->GetWorld()->BroadcastPlayerAnimation(*m_Player, 3); + break; + } } } @@ -1560,9 +1574,9 @@ void cClientHandle::SendExplosion(double a_BlockX, double a_BlockY, double a_Blo -void cClientHandle::SendMetadata(const cPawn & a_Pawn) +void cClientHandle::SendMetadata(const cEntity & a_Entity) { - m_Protocol->SendMetadata(a_Pawn); + m_Protocol->SendMetadata(a_Entity); } -- cgit v1.2.3