summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemThrowable.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-10 08:28:27 +0200
committerarchshift <admin@archshift.com>2014-07-10 08:28:27 +0200
commite824cd09b369c47a7f316fccc7577cd923164466 (patch)
treed8efa178a29955525458a38b1351ea0b609a2a09 /src/Items/ItemThrowable.h
parentEntityEffects.x -> EntityEffect.x, Object-Oriented effects (diff)
parentMerge pull request #1157 from Howaner/Window (diff)
downloadcuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.gz
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.bz2
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.lz
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.xz
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.tar.zst
cuberite-e824cd09b369c47a7f316fccc7577cd923164466.zip
Diffstat (limited to 'src/Items/ItemThrowable.h')
-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;