1
0

Changed BroadcastSoundEffect function to take floating pos.

This commit is contained in:
Howaner
2014-07-13 02:08:02 +02:00
parent 6484e9814a
commit d529971e27
36 changed files with 77 additions and 83 deletions

View File

@@ -1084,15 +1084,19 @@ void cProtocol172::SendDisplayObjective(const AString & a_Objective, cScoreboard
void cProtocol172::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) // a_Src coords are Block * 8
void cProtocol172::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
{
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(a_SrcX);
Pkt.WriteInt(a_SrcY);
Pkt.WriteInt(a_SrcZ);
Pkt.WriteInt(SrcX);
Pkt.WriteInt(SrcY);
Pkt.WriteInt(SrcZ);
Pkt.WriteFloat(a_Volume);
Pkt.WriteByte((Byte)(a_Pitch * 63));
}