]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/target/music.qc
Merge branch 'master' into DefaultUser/trigger_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / target / music.qc
index 24951b42b3b6a40427f2edb310a9976fbeb008fb..5a63872dbd6c46b6742b3534be7b4531c0d38ef2 100644 (file)
@@ -237,16 +237,13 @@ void Net_TargetMusic()
        }
        if(e.noise != noi)
        {
-               if(e.noise)
-                       strunzone(e.noise);
-               e.noise = strzone(noi);
+               strcpy(e.noise, noi);
                precache_sound(e.noise);
                _sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
                if(getsoundtime(e, CH_BGM_SINGLE) < 0)
                {
                        LOG_TRACEF("Cannot initialize sound %s", e.noise);
-                       strunzone(e.noise);
-                       e.noise = string_null;
+                       strfree(e.noise);
                }
        }
        e.volume = vol;
@@ -288,9 +285,7 @@ void Ent_TriggerMusic_Think(entity this)
 
 void Ent_TriggerMusic_Remove(entity this)
 {
-       if(this.noise)
-               strunzone(this.noise);
-       this.noise = string_null;
+    strfree(this.noise);
 }
 
 NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
@@ -318,9 +313,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
                this.fade_time = ReadByte() / 16.0;
                this.fade_rate = ReadByte() / 16.0;
                string s = this.noise;
-               if(this.noise)
-                       strunzone(this.noise);
-               this.noise = strzone(ReadString());
+               strcpy(this.noise, ReadString());
                if(this.noise != s)
                {
                        precache_sound(this.noise);
@@ -328,8 +321,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
                        if(getsoundtime(this, CH_BGM_SINGLE) < 0)
                        {
                                LOG_WARNF("Cannot initialize sound %s", this.noise);
-                               strunzone(this.noise);
-                               this.noise = string_null;
+                               strfree(this.noise);
                        }
                }
        }