From f9fd0d7ae43b9c085056923835e9aff022a25618 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 11 Jan 2017 01:55:59 +1000 Subject: [PATCH] Fix a couple of precache warnings with doors and plats --- qcsrc/common/triggers/func/door.qc | 5 +++-- qcsrc/common/triggers/func/plat.qc | 13 +++---------- 2 files changed, 6 insertions(+), 12 deletions(-) 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'; -- 2.39.2