diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-06 20:59:14 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-06 20:59:14 +0100 |
commit | 44d5fd1e879dbdafc72097edfb1ad35367503e95 (patch) | |
tree | 0a0c34ce68ff64b8ddea759b3c559466c6aee934 /src/Entities | |
parent | Cleaned up torch code and added comments (diff) | |
download | cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.tar cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.tar.gz cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.tar.bz2 cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.tar.lz cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.tar.xz cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.tar.zst cuberite-44d5fd1e879dbdafc72097edfb1ad35367503e95.zip |
Diffstat (limited to 'src/Entities')
-rw-r--r-- | src/Entities/Player.cpp | 5 | ||||
-rw-r--r-- | src/Entities/ProjectileEntity.cpp | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 910613e98..bfacc3422 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1575,7 +1575,10 @@ void cPlayer::UseEquippedItem(void) return; } - GetInventory().DamageEquippedItem(); + if (GetInventory().DamageEquippedItem()) + { + m_World->BroadcastSoundEffect("random.break", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); + } } diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index fb25aea35..1d49c2445 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -466,7 +466,7 @@ void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) m_HitBlockPos = Vector3i(a_X, a_Y, a_Z); // Broadcast arrow hit sound - m_World->BroadcastSoundEffect("random.bowhit", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); + m_World->BroadcastSoundEffect("random.bowhit", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); } |