diff options
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r-- | src/ClientHandle.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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(); + } } |