]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/target/speaker.qc
Add support for pitch shifting to the QC sound sending implementation, apply pitch...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / target / speaker.qc
index 11c9ad7baef1d7c682feae42db5fa9162325532a..6766139c5db5008758d1c203a52594dd599e7641 100644 (file)
@@ -28,7 +28,7 @@ void target_speaker_use_activator(entity this, entity actor, entity trigger)
        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)
 {
@@ -83,7 +83,7 @@ spawnfunc(target_speaker)
        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;
@@ -91,7 +91,7 @@ spawnfunc(target_speaker)
 
        if(!this.atten)
        {
-               IFTARGETED
+               if(this.targetname && this.targetname != "")
                        this.atten = ATTEN_NORM;
                else
                        this.atten = ATTEN_STATIC;
@@ -102,7 +102,7 @@ spawnfunc(target_speaker)
        if(!this.volume)
                this.volume = 1;
 
-       IFTARGETED
+       if(this.targetname && this.targetname != "")
        {
                if(this.spawnflags & SPEAKER_ACTIVATOR)
                        this.use = target_speaker_use_activator;