Merge pull request #812 from kuangshen04/PR-Branch

修复资料页播放部分不存在的语音导致卡死的问题
This commit is contained in:
Spmario233 2024-01-19 01:46:46 +08:00 committed by GitHub
commit e27acf8b59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -13418,12 +13418,14 @@ class Click extends Uninstantable {
// 有bug先用旧版
if (lib.config.background_speak && e !== 'init') {
let audio, skillnode = this;
const playedAudios = [];
(function play() {
if (!skillnode.audioList || !skillnode.audioList.length) {
skillnode.audioList = game.parseSkillAudio(skillnode.link, playername);
if (!skillnode.audioList.length) return;
if (!skillnode.audioList.length||skillnode.audioList.length==playedAudios.length) return;
}
audio = skillnode.audioList.shift();
playedAudios.push(audio);
game.playAudio(audio, play);
})();
}
@ -13633,12 +13635,14 @@ class Click extends Uninstantable {
// 有bug先用旧版
if (lib.config.background_speak && e !== 'init') {
let audio, skillnode = this;
const playedAudios = [];
(function play() {
if (!skillnode.audioList || !skillnode.audioList.length) {
skillnode.audioList = game.parseSkillAudio(skillnode.link, playername);
if (!skillnode.audioList.length) return;
if (!skillnode.audioList.length||skillnode.audioList.length==playedAudios.length) return;
}
audio = skillnode.audioList.shift();
playedAudios.push(audio);
game.playAudio(audio, play);
})();
}