diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-05-28 16:39:59 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-05-28 16:39:59 +0200 |
commit | e7a7c45c3681e90cb9ab13d16935aae9860f1077 (patch) | |
tree | 8f00748405253e045acab59c7426c17b101eebe1 /src/Items | |
parent | Fix Y-Position from arrow entity. (diff) | |
download | cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.tar cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.tar.gz cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.tar.bz2 cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.tar.lz cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.tar.xz cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.tar.zst cuberite-e7a7c45c3681e90cb9ab13d16935aae9860f1077.zip |
Diffstat (limited to 'src/Items')
-rw-r--r-- | src/Items/ItemThrowable.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h index 35c2b8731..25935a1bc 100644 --- a/src/Items/ItemThrowable.h +++ b/src/Items/ItemThrowable.h @@ -31,6 +31,17 @@ public: Vector3d Pos = a_Player->GetThrowStartPos(); Vector3d Speed = a_Player->GetLookVector() * m_SpeedCoeff; + // Play sound + cFastRandom Random; + a_World->BroadcastSoundEffect( + "random.bow", + (int)std::floor(a_Player->GetPosX() * 8.0), + (int)std::floor((a_Player->GetPosY() - a_Player->GetHeight()) * 8.0), + (int)std::floor(a_Player->GetPosZ() * 8.0), + 0.5F, + 0.4F / (Random.NextFloat(1.0F) * 0.4F + 0.8F) + ); + if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, a_Player->GetEquippedItem(), &Speed) < 0) { return false; |