diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-03-09 22:43:15 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-03-09 22:43:15 +0100 |
commit | 1985a9c33edc5b929f88871ce553b148408571af (patch) | |
tree | 08124cd9f2ea2171710b2dfb764d6b7dfee5701f /src/Items | |
parent | Mentiod that we use some c++11 exstensions (diff) | |
parent | != FACE_NONE (diff) | |
download | cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.gz cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.bz2 cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.lz cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.xz cuberite-1985a9c33edc5b929f88871ce553b148408571af.tar.zst cuberite-1985a9c33edc5b929f88871ce553b148408571af.zip |
Diffstat (limited to 'src/Items')
-rw-r--r-- | src/Items/ItemThrowable.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h index 46049f961..c6a4e714e 100644 --- a/src/Items/ItemThrowable.h +++ b/src/Items/ItemThrowable.h @@ -35,7 +35,7 @@ public: 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); + a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, a_Player->GetEquippedItem(), &Speed); return true; } @@ -127,13 +127,13 @@ public: return false; } + a_World->CreateProjectile(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5, m_ProjectileKind, a_Player, a_Player->GetEquippedItem()); + if (!a_Player->IsGameModeCreative()) { a_Player->GetInventory().RemoveOneEquippedItem(); } - a_World->CreateProjectile(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5, m_ProjectileKind, a_Player, 0); - return true; } |