From 7b603f3c9553690f9d7a334b6fb3f6e47eb10ee5 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Thu, 3 Oct 2019 12:34:15 +0200 Subject: Added another check if the item is place able (#4404) --- src/ClientHandle.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index f80b5c5af..79698ad64 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1461,6 +1461,13 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e PlgMgr->CallHookPlayerUsedBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta); Success = true; } + + // Check if the item is place able, for example a torch on a fence + if (!Success && Placeable) + { + // place a block + Success = ItemHandler->OnPlayerPlace(*World, *m_Player, HeldItem, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ); + } } else { -- cgit v1.2.3