diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-06-16 23:41:23 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-06-16 23:41:23 +0200 |
commit | a1fd0b0335a5b19af29a4862f4d0ac39bec6887f (patch) | |
tree | d91c0bf3f621e4e4a1341f1d7b6a00cf201243d3 /src/Entities | |
parent | This isn't needed (diff) | |
download | cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.tar cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.tar.gz cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.tar.bz2 cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.tar.lz cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.tar.xz cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.tar.zst cuberite-a1fd0b0335a5b19af29a4862f4d0ac39bec6887f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/ArrowEntity.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp index bdbaaab0d..7f2c8dca5 100644 --- a/src/Entities/ArrowEntity.cpp +++ b/src/Entities/ArrowEntity.cpp @@ -114,7 +114,14 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) a_EntityHit.TakeDamage(dtRangedAttack, this, Damage, 1); // Broadcast successful hit sound - m_World->BroadcastSoundEffect("random.successful_hit", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); + m_World->BroadcastSoundEffect( + "random.successful_hit", + (int)std::floor(GetPosX() * 8.0), + (int)std::floor(GetPosY() * 8.0), + (int)std::floor(GetPosZ() * 8.0), + 0.5, + (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64) + ); Destroy(); } @@ -141,7 +148,14 @@ void cArrowEntity::CollectedBy(cPlayer * a_Dest) m_bIsCollected = true; cFastRandom Random; - m_World->BroadcastSoundEffect("random.pop", (int)std::floor(GetPosX() * 8.0), (int)std::floor(GetPosY() * 8), (int)std::floor(GetPosZ() * 8), 0.2F, ((Random.NextFloat(1.0F) - Random.NextFloat(1.0F)) * 0.7F + 1.0F) * 2.0F); + m_World->BroadcastSoundEffect( + "random.pop", + (int)std::floor(GetPosX() * 8.0), + (int)std::floor(GetPosY() * 8), + (int)std::floor(GetPosZ() * 8), + 0.2F, + ((Random.NextFloat(1.0F) - Random.NextFloat(1.0F)) * 0.7F + 1.0F) * 2.0F + ); } } |