From 1d7caccb3253706cf05bc5381452c34359235cb0 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sun, 23 Dec 2018 17:37:26 +0800 Subject: [PATCH] Avoid preload while music off --- libs/loader.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/loader.js b/libs/loader.js index d5185100..0715d5df 100644 --- a/libs/loader.js +++ b/libs/loader.js @@ -272,6 +272,8 @@ loader.prototype.freeBgm = function (name) { loader.prototype.loadBgm = function (name) { if (!core.isset(core.material.bgms[name])) return; + // 如果没开启音乐,则不预加载 + if (!core.musicStatus.bgmStatus) return; // 是否已经预加载过 var index = core.musicStatus.cachedBgms.indexOf(name); if (index>=0) {