diff options
author | Mattes D <github@xoft.cz> | 2013-11-02 17:05:16 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-11-02 17:05:16 +0100 |
commit | c5b6d68517f8a93d52e684e00cf053de6a31ab99 (patch) | |
tree | 65a8c524577e76cf353f7478ab1f869bfe4bd2db /source/Items/ItemThrowable.h | |
parent | Protocol 1.7: Implemented the first batch of sent packets. (diff) | |
parent | Fixed bow damage in creative (diff) | |
download | cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.tar cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.tar.gz cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.tar.bz2 cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.tar.lz cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.tar.xz cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.tar.zst cuberite-c5b6d68517f8a93d52e684e00cf053de6a31ab99.zip |
Diffstat (limited to 'source/Items/ItemThrowable.h')
-rw-r--r-- | source/Items/ItemThrowable.h | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |