]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a couple of precache warnings with doors and plats
authorMario <mario@smbclan.net>
Tue, 10 Jan 2017 15:55:59 +0000 (01:55 +1000)
committerMario <mario@smbclan.net>
Tue, 10 Jan 2017 15:55:59 +0000 (01:55 +1000)
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/plat.qc

index 8a82802607bdcdb09f505d11248419d5e4d20977..b0cc44f96543adbc7c23c4f14cca4b821f58492f 100644 (file)
@@ -732,12 +732,13 @@ spawnfunc(func_door)
 
        if (this.sounds > 0)
        {
-               precache_sound ("plats/medplat1.wav");
-               precache_sound ("plats/medplat2.wav");
                this.noise2 = "plats/medplat1.wav";
                this.noise1 = "plats/medplat2.wav";
        }
 
+       if(this.noise1 && this.noise1 != "") { precache_sound(this.noise1); }
+       if(this.noise2 && this.noise2 != "") { precache_sound(this.noise2); }
+
        if (!this.speed)
                this.speed = 100;
        if (!this.wait)
index 5d90924daa248b0e079f8ff4bc99bf5b6c4e125e..36b4eeffffa1dd1af0d57f66b7207e2fde7c9802 100644 (file)
@@ -73,30 +73,23 @@ spawnfunc(func_plat)
 
        if (this.sounds == 1)
        {
-               precache_sound ("plats/plat1.wav");
-               precache_sound ("plats/plat2.wav");
                this.noise = "plats/plat1.wav";
                this.noise1 = "plats/plat2.wav";
        }
 
        if (this.sounds == 2)
        {
-               precache_sound ("plats/medplat1.wav");
-               precache_sound ("plats/medplat2.wav");
                this.noise = "plats/medplat1.wav";
                this.noise1 = "plats/medplat2.wav";
        }
 
        if (this.sound1)
-       {
-               precache_sound (this.sound1);
                this.noise = this.sound1;
-       }
        if (this.sound2)
-       {
-               precache_sound (this.sound2);
                this.noise1 = this.sound2;
-       }
+
+       if(this.noise && this.noise != "") { precache_sound(this.noise); }
+       if(this.noise1 && this.noise1 != "") { precache_sound(this.noise1); }
 
        this.mangle = this.angles;
        this.angles = '0 0 0';