diff options
author | madmaxoft <github@xoft.cz> | 2014-07-13 13:31:09 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-13 13:31:09 +0200 |
commit | 31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2 (patch) | |
tree | beccd7d4a05039ba5055e44721875ec15befae27 /src | |
parent | Update. (diff) | |
download | cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.tar cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.tar.gz cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.tar.bz2 cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.tar.lz cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.tar.xz cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.tar.zst cuberite-31415aec63f03aeb92ec17ad3a3acb27aa6b2fc2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ChunkMap.cpp | 2 | ||||
-rw-r--r-- | src/Protocol/Protocol132.cpp | 10 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 10 |
3 files changed, 7 insertions, 15 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 0a0a841cd..b24eead2d 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -652,7 +652,7 @@ void cChunkMap::BroadcastSoundEffect(const AString & a_SoundName, double a_X, do cCSLock Lock(m_CSLayers); int ChunkX, ChunkZ; - cChunkDef::BlockToChunk(std::floor(a_X), std::floor(a_Z), ChunkX, ChunkZ); + cChunkDef::BlockToChunk((int)std::floor(a_X), (int)std::floor(a_Z), ChunkX, ChunkZ); cChunkPtr Chunk = GetChunkNoGen(ChunkX, 0, ChunkZ); if (Chunk == NULL) { diff --git a/src/Protocol/Protocol132.cpp b/src/Protocol/Protocol132.cpp index b2b84953c..7a8c2221e 100644 --- a/src/Protocol/Protocol132.cpp +++ b/src/Protocol/Protocol132.cpp @@ -280,16 +280,12 @@ void cProtocol132::SendPlayerSpawn(const cPlayer & a_Player) 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 (SrcX); - WriteInt (SrcY); - WriteInt (SrcZ); + WriteInt ((int)(a_X * 8.0)); + WriteInt ((int)(a_Y * 8.0)); + WriteInt ((int)(a_Z * 8.0)); WriteFloat (a_Volume); WriteChar ((char)(a_Pitch * 63.0f)); Flush(); diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index ae077d69e..dc6a817a3 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1088,15 +1088,11 @@ void cProtocol172::SendSoundEffect(const AString & a_SoundName, double a_X, doub { ASSERT(m_State == 3); // In game mode? - int SrcX = std::floor(a_X * 8.0); - int SrcY = std::floor(a_Y * 8.0); - int SrcZ = std::floor(a_Z * 8.0); - cPacketizer Pkt(*this, 0x29); // Sound Effect packet Pkt.WriteString(a_SoundName); - Pkt.WriteInt(SrcX); - Pkt.WriteInt(SrcY); - Pkt.WriteInt(SrcZ); + Pkt.WriteInt((int)(a_X * 8.0)); + Pkt.WriteInt((int)(a_Y * 8.0)); + Pkt.WriteInt((int)(a_Z * 8.0)); Pkt.WriteFloat(a_Volume); Pkt.WriteByte((Byte)(a_Pitch * 63)); } |