From 77b3db7e25c401d4ff78ee4fe291880df441a6fe Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 2 Nov 2013 14:08:00 +0000 Subject: Multiple fixes * Fixed #282 * Fixed bow not taking damage * Enhanced Player.cpp code --- source/Items/ItemThrowable.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/Items/ItemThrowable.h') diff --git a/source/Items/ItemThrowable.h b/source/Items/ItemThrowable.h index dacdb6157..85579daf2 100644 --- a/source/Items/ItemThrowable.h +++ b/source/Items/ItemThrowable.h @@ -28,9 +28,15 @@ public: virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir) override { + if (!a_Player->IsGameModeCreative()) + { + a_Player->GetInventory().RemoveOneEquippedItem(); + } + Vector3d Pos = a_Player->GetThrowStartPos(); Vector3d Speed = a_Player->GetLookVector() * m_SpeedCoeff; a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, &Speed); + return true; } -- cgit v1.2.3