Changed BroadcastSoundEffect function to take floating pos.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user