diff options
author | Pablo Beltrán <spekdrum@gmail.com> | 2017-05-24 08:09:58 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-05-24 08:09:58 +0200 |
commit | 84bdba345d9b34a59337009d0880aa74d3b2d689 (patch) | |
tree | b9b4e5580591c94d23e0ac0de6ce9e980101c6ef /src/ClientHandle.cpp | |
parent | Store cChunk::m_BlockEntities in a map (#3717) (diff) | |
download | cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.gz cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.bz2 cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.lz cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.xz cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.tar.zst cuberite-84bdba345d9b34a59337009d0880aa74d3b2d689.zip |
Diffstat (limited to '')
-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(); + } } |