diff options
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 6fd779b0c..aa223f5df 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -205,7 +205,7 @@ void cClientHandle::Kick(const AString & a_Reason) { if (m_State >= csAuthenticating) // Don't log pings { - LOG("Kicking user \"%s\" for \"%s\"", m_Username.c_str(), StripColorCodes(a_Reason).c_str()); + LOGINFO("Kicking player %s for \"%s\"", m_Username.c_str(), StripColorCodes(a_Reason).c_str()); } SendDisconnect(a_Reason); } @@ -685,12 +685,10 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc int pX = a_BlockX; int pY = a_BlockY; int pZ = a_BlockZ; - AddFaceDirection(pX, pY, pZ, a_BlockFace); + AddFaceDirection(pX, pY, pZ, a_BlockFace); // Get the block in front of the clicked coordinates (m_bInverse defaulted to false) Handler = cBlockHandler::GetBlockHandler(World->GetBlock(pX, pY, pZ)); - - // 2013_01_05 _X: This looks weird - // Why do we ask the block "behind" the one being clicked if it is clicked through? Shouldn't we ask the primary block instead? + if (Handler->IsClickedThrough()) { Handler->OnDigging(World, m_Player, pX, pY, pZ); @@ -886,7 +884,10 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, c ) ) { - // Coordinates at CLICKED block, don't move them anywhere + // Coordinates at clicked block, which was an eligible slab, and either top or bottom faces were clicked + // If clicked top face and slab occupies the top voxel, we want a slab to be placed above it (therefore increment Y) + // Else if clicked bottom face and slab occupies the bottom voxel, decrement Y for the same reason + // Don't touch coordinates if anything else because a dblslab opportunity is present if((ClickedBlockMeta & 0x08) && (a_BlockFace == BLOCK_FACE_TOP)) { ++a_BlockY; @@ -1052,13 +1053,13 @@ void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_ void cClientHandle::HandleAnimation(char a_Animation) { - if (cPluginManager::Get()->CallHookPlayerAnimation(*m_Player, a_Animation)) + if (cPluginManager::Get()->CallHookEntityAnimation(*m_Player, a_Animation)) { // Plugin disagrees, bail out return; } - m_Player->GetWorld()->BroadcastPlayerAnimation(*m_Player, a_Animation, this); + m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this); } @@ -1263,19 +1264,19 @@ void cClientHandle::HandleEntityAction(int a_EntityID, char a_ActionID) switch (a_ActionID) { - case 1: // crouch + case 1: // Crouch { m_Player->SetCrouch(true); break; } - case 2: // uncrouch + case 2: // Uncrouch { m_Player->SetCrouch(false); break; } case 3: // Leave bed { - m_Player->GetWorld()->BroadcastPlayerAnimation(*m_Player, 3); + m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, 2); break; } case 4: // Start sprinting @@ -1812,9 +1813,9 @@ void cClientHandle::SendPickupSpawn(const cPickup & a_Pickup) -void cClientHandle::SendPlayerAnimation(const cPlayer & a_Player, char a_Animation) +void cClientHandle::SendEntityAnimation(const cEntity & a_Entity, char a_Animation) { - m_Protocol->SendPlayerAnimation(a_Player, a_Animation); + m_Protocol->SendEntityAnimation(a_Entity, a_Animation); } |