else
snd = this.noise;
msg_entity = actor;
- soundto(MSG_ONE, this, CH_TRIGGER, snd, VOL_BASE * this.volume, this.atten);
+ soundto(MSG_ONE, this, CH_TRIGGER, snd, VOL_BASE * this.volume, this.atten, 0);
}
void target_speaker_use_on(entity this, entity actor, entity trigger)
{
if(this.noise)
precache_sound (this.noise);
- if(!this.atten && (this.spawnflags & SPEAKER_GLOBAL))
+ if(!this.atten && (this.spawnflags & SPEAKER_GLOBAL) && !(this.spawnflags & 3)) // special check for quake 3: looped sounds are never global
{
LOG_WARN("target_speaker uses legacy spawnflag GLOBAL (BIT(2)), please set atten to -1 instead");
this.atten = -1;
if(!this.atten)
{
- IFTARGETED
+ if(this.targetname && this.targetname != "")
this.atten = ATTEN_NORM;
else
this.atten = ATTEN_STATIC;
if(!this.volume)
this.volume = 1;
- IFTARGETED
+ if(this.targetname && this.targetname != "")
{
if(this.spawnflags & SPEAKER_ACTIVATOR)
this.use = target_speaker_use_activator;