From 487f9a2aa9b5497495cef1ac3b9c7a603e69f862 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 21 Apr 2020 22:19:22 +0200 Subject: Vector3 in Handlers (#4680) Refactored all cBlockHandler and cItemHandler descendants to use Vector3. --- src/Items/ItemBow.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/Items/ItemBow.h') diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index 81f012c7c..b7a9ef638 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -22,9 +22,15 @@ public: + + virtual bool OnItemUse( - cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item, - int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace + cWorld * a_World, + cPlayer * a_Player, + cBlockPluginInterface & a_PluginInterface, + const cItem & a_HeldItem, + const Vector3i a_ClickedBlockPos, + eBlockFace a_ClickedBlockFace ) override { ASSERT(a_Player != nullptr); @@ -41,9 +47,10 @@ public: - virtual void OnItemShoot(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override + virtual void OnItemShoot(cPlayer * a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace) override { - // Actual shot - produce the arrow with speed based on the ticks that the bow was charged + // Actual shot - produce the arrow with speed based on the number of ticks that the bow was charged + UNUSED(a_BlockPos); ASSERT(a_Player != nullptr); int BowCharge = a_Player->FinishChargingBow(); @@ -88,7 +95,6 @@ public: a_Player->UseEquippedItem(); } - if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchFlame) > 0) { ArrowPtr->StartBurning(100); -- cgit v1.2.3