]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/target/music.qc
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / target / music.qc
index 7ec3351381b6265b0d24e4e16c02caa80d32fe2d..47977f267eff651f01575b1a13fddf01956f9640 100644 (file)
@@ -215,16 +215,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;
@@ -262,9 +259,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)
@@ -292,9 +287,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);
@@ -302,8 +295,7 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_MUSIC, bool isnew)
                        if(getsoundtime(this, CH_BGM_SINGLE) < 0)
                        {
                                LOG_TRACEF("Cannot initialize sound %s", this.noise);
-                               strunzone(this.noise);
-                               this.noise = string_null;
+                               strfree(this.noise);
                        }
                }
        }