bool autocvar_bot_sound_monopoly;
.entity realowner;
bool sound_allowed(int to, entity e)
{
bool autocvar_bot_sound_monopoly;
.entity realowner;
bool sound_allowed(int to, entity e)
{
const int SND_ATTENUATION = BIT(1);
const int SND_LARGEENTITY = BIT(3);
const int SND_LARGESOUND = BIT(4);
const int SND_ATTENUATION = BIT(1);
const int SND_LARGEENTITY = BIT(3);
const int SND_LARGESOUND = BIT(4);
-void soundtoat(int to, entity e, vector o, int chan, string samp, float vol, float attenu)
+void soundtoat(int to, entity e, vector o, int chan, string samp, float vol, float attenu, float _pitch)
if (vol != 255) sflags |= SND_VOLUME;
if (attenu != 64) sflags |= SND_ATTENUATION;
if (entno >= 8192 || chan < 0 || chan > 7) sflags |= SND_LARGEENTITY;
if (idx >= 256) sflags |= SND_LARGESOUND;
if (vol != 255) sflags |= SND_VOLUME;
if (attenu != 64) sflags |= SND_ATTENUATION;
if (entno >= 8192 || chan < 0 || chan > 7) sflags |= SND_LARGEENTITY;
if (idx >= 256) sflags |= SND_LARGESOUND;
WriteByte(to, SVC_SOUND);
WriteByte(to, sflags);
if (sflags & SND_VOLUME) WriteByte(to, vol);
if (sflags & SND_ATTENUATION) WriteByte(to, attenu);
WriteByte(to, SVC_SOUND);
WriteByte(to, sflags);
if (sflags & SND_VOLUME) WriteByte(to, vol);
if (sflags & SND_ATTENUATION) WriteByte(to, attenu);
-void soundto(int _dest, entity e, int chan, string samp, float vol, float _atten)
+void soundto(int _dest, entity e, int chan, string samp, float vol, float _atten, float _pitch)
{
if (!sound_allowed(_dest, e)) return;
vector o = e.origin + 0.5 * (e.mins + e.maxs);
{
if (!sound_allowed(_dest, e)) return;
vector o = e.origin + 0.5 * (e.mins + e.maxs);
- soundtoat(_dest, e, o, chan, samp, vol, _atten);
+ soundtoat(_dest, e, o, chan, samp, vol, _atten, _pitch);
}
void soundat(entity e, vector o, int chan, string samp, float vol, float _atten)
{
}
void soundat(entity e, vector o, int chan, string samp, float vol, float _atten)
{
- soundtoat(((chan & 8) ? MSG_ALL : MSG_BROADCAST), e, o, chan, samp, vol, _atten);
+ soundtoat(((chan & 8) ? MSG_ALL : MSG_BROADCAST), e, o, chan, samp, vol, _atten, 0);
- soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
+ soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE, 0);