From 4fe41839ccaf9d78e8288c24a20448d469770f4e Mon Sep 17 00:00:00 2001 From: Howaner <franzi.moos@googlemail.com> Date: Tue, 21 Oct 2014 21:13:35 +0200 Subject: [PATCH] Reverted hook move. --- src/ClientHandle.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 1daa398bd..f15d845ef 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1118,12 +1118,6 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo cWorld * World = m_Player->GetWorld(); cItemHandler * ItemHandler = cItemHandler::GetItemHandler(m_Player->GetEquippedItem()); - if (a_OldBlock == E_BLOCK_AIR) - { - LOGD("Dug air - what the function?"); - return; - } - if (cRoot::Get()->GetPluginManager()->CallHookPlayerBreakingBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_OldBlock, a_OldMeta)) { // A plugin doesn't agree with the breaking. Bail out. Send the block back to the client, so that it knows: @@ -1131,6 +1125,12 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo return; } + if (a_OldBlock == E_BLOCK_AIR) + { + LOGD("Dug air - what the function?"); + return; + } + m_Player->AddFoodExhaustion(0.025); ItemHandler->OnBlockDestroyed(World, m_Player, m_Player->GetEquippedItem(), a_BlockX, a_BlockY, a_BlockZ); // The ItemHandler is also responsible for spawning the pickups