From 84bdba345d9b34a59337009d0880aa74d3b2d689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Beltr=C3=A1n?= Date: Wed, 24 May 2017 08:09:58 +0200 Subject: Off-hand/shield slot functional, save and load slot, bow + arrow functional (#3725) Fixes #3714. --- src/ClientHandle.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 669138f72..17b93a62c 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1111,6 +1111,11 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB // A plugin doesn't agree with the action. The plugin itself is responsible for handling the consequences (possible inventory mismatch) return; } + // When bow is in off-hand / shield slot + if (m_Player->GetInventory().GetShieldSlot().m_ItemType == E_ITEM_BOW) + { + ItemHandler = cItemHandler::GetItemHandler(m_Player->GetInventory().GetShieldSlot()); + } ItemHandler->OnItemShoot(m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); } return; @@ -1524,6 +1529,11 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e ItemHandler->OnItemUse(World, m_Player, PluginInterface, Equipped, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace); PlgMgr->CallHookPlayerUsedItem(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ); } + // Charge bow when it's in slot off-hand / shield + if ((a_BlockFace == BLOCK_FACE_NONE) && (m_Player->GetInventory().GetShieldSlot().m_ItemType == E_ITEM_BOW)) + { + m_Player->StartChargingBow(); + } } -- cgit v1.2.3