From: Mario Date: Tue, 10 Jan 2017 15:55:59 +0000 (+1000) Subject: Fix a couple of precache warnings with doors and plats X-Git-Tag: xonotic-v0.8.2~302 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f9fd0d7ae43b9c085056923835e9aff022a25618;p=xonotic%2Fxonotic-data.pk3dir.git Fix a couple of precache warnings with doors and plats --- diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index 8a8280260..b0cc44f96 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -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) diff --git a/qcsrc/common/triggers/func/plat.qc b/qcsrc/common/triggers/func/plat.qc index 5d90924da..36b4eefff 100644 --- a/qcsrc/common/triggers/func/plat.qc +++ b/qcsrc/common/triggers/func/plat.qc @@ -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';