summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemThrowable.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-06-18 18:23:18 +0200
committerMattes D <github@xoft.cz>2014-06-18 18:23:18 +0200
commitc30b7b87354cd7868dd986008ac91187390a08b2 (patch)
tree5f7222853d649ca5e66a2640462b4468be6fd79e /src/Items/ItemThrowable.h
parentMerge pull request #1100 from Howaner/Slabs (diff)
parentMerge branch 'master' into GlobalFixes (diff)
downloadcuberite-c30b7b87354cd7868dd986008ac91187390a08b2.tar
cuberite-c30b7b87354cd7868dd986008ac91187390a08b2.tar.gz
cuberite-c30b7b87354cd7868dd986008ac91187390a08b2.tar.bz2
cuberite-c30b7b87354cd7868dd986008ac91187390a08b2.tar.lz
cuberite-c30b7b87354cd7868dd986008ac91187390a08b2.tar.xz
cuberite-c30b7b87354cd7868dd986008ac91187390a08b2.tar.zst
cuberite-c30b7b87354cd7868dd986008ac91187390a08b2.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemThrowable.h11
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;