From 3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 8 Feb 2015 21:21:48 +0000 Subject: Handle client 'leave bed' request * Fixes #1728 --- src/ClientHandle.cpp | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index c774a92c2..61ec73633 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -18,6 +18,7 @@ #include "Items/ItemHandler.h" #include "Blocks/BlockHandler.h" #include "Blocks/BlockSlab.h" +#include "Blocks/BlockBed.h" #include "Blocks/ChunkInterface.h" #include "Root.h" @@ -1498,30 +1499,6 @@ void cClientHandle::HandleAnimation(int a_Animation) 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); } @@ -1763,7 +1740,8 @@ void cClientHandle::HandleEntityLeaveBed(int a_EntityID) return; } - m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, 2); + cBlockBedHandler::SetBedOccupationState(cChunkInterface(GetPlayer()->GetWorld()->GetChunkMap()), GetPlayer()->GetLastBedPos(), false); + GetPlayer()->SetIsInBed(false); } -- cgit v1.2.3 From f3da0cf1ae96048bb84a083099faec0b0a736bf1 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 5 Mar 2015 21:21:39 +0000 Subject: Reverted non-functional changes --- src/ClientHandle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 61ec73633..9a3c59b86 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1740,7 +1740,8 @@ void cClientHandle::HandleEntityLeaveBed(int a_EntityID) return; } - cBlockBedHandler::SetBedOccupationState(cChunkInterface(GetPlayer()->GetWorld()->GetChunkMap()), GetPlayer()->GetLastBedPos(), false); + cChunkInterface Interface(GetPlayer()->GetWorld()->GetChunkMap()); + cBlockBedHandler::SetBedOccupationState(Interface, GetPlayer()->GetLastBedPos(), false); GetPlayer()->SetIsInBed(false); } -- cgit v1.2.3