diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-07-13 02:08:02 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-07-13 02:08:02 +0200 |
commit | d529971e279609ae928d9077404b95bd595b5e52 (patch) | |
tree | 34aeac132b9cb73b7b68a1285815c168506e247c /src/Protocol/Protocol132.cpp | |
parent | Only one instance of server can be started (diff) | |
download | cuberite-d529971e279609ae928d9077404b95bd595b5e52.tar cuberite-d529971e279609ae928d9077404b95bd595b5e52.tar.gz cuberite-d529971e279609ae928d9077404b95bd595b5e52.tar.bz2 cuberite-d529971e279609ae928d9077404b95bd595b5e52.tar.lz cuberite-d529971e279609ae928d9077404b95bd595b5e52.tar.xz cuberite-d529971e279609ae928d9077404b95bd595b5e52.tar.zst cuberite-d529971e279609ae928d9077404b95bd595b5e52.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol132.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Protocol/Protocol132.cpp b/src/Protocol/Protocol132.cpp index 31cf99f53..b2b84953c 100644 --- a/src/Protocol/Protocol132.cpp +++ b/src/Protocol/Protocol132.cpp @@ -195,13 +195,6 @@ void cProtocol132::SendCollectEntity(const cEntity & a_Entity, const cPlayer & a WriteInt (a_Entity.GetUniqueID()); WriteInt (a_Player.GetUniqueID()); Flush(); - - // Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;) - SendSoundEffect( - "random.pop", - (int)(a_Entity.GetPosX() * 8), (int)(a_Entity.GetPosY() * 8), (int)(a_Entity.GetPosZ() * 8), - 0.5, (float)(0.75 + ((float)((a_Entity.GetUniqueID() * 23) % 32)) / 64) - ); } @@ -285,14 +278,18 @@ void cProtocol132::SendPlayerSpawn(const cPlayer & a_Player) -void cProtocol132::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) +void cProtocol132::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) { + int SrcX = std::floor(a_X * 8.0); + int SrcY = std::floor(a_Y * 8.0); + int SrcZ = std::floor(a_Z * 8.0); + cCSLock Lock(m_CSPacket); WriteByte (PACKET_SOUND_EFFECT); WriteString (a_SoundName); - WriteInt (a_SrcX); - WriteInt (a_SrcY); - WriteInt (a_SrcZ); + WriteInt (SrcX); + WriteInt (SrcY); + WriteInt (SrcZ); WriteFloat (a_Volume); WriteChar ((char)(a_Pitch * 63.0f)); Flush(); |