From c54fbd15bc8f55619e26d2bf09eeb740daa2b7d8 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Mon, 21 Aug 2023 21:17:42 -0700 Subject: [PATCH] Ensure the compatibility. --- game/game.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index 1da88204c..875b3442c 100644 --- a/game/game.js +++ b/game/game.js @@ -9750,6 +9750,7 @@ } str=`if(event.step==${k}){event.finish();return;}`+str; } + str=`"use strict";\n${str}`; return (new Function('event','step','source','player','target','targets', 'card','cards','skill','forced','num','trigger','result', '_status','lib','game','ui','get','ai',str)); @@ -11179,7 +11180,10 @@ game.resume(); _status.imchoosing=false; if(roundmenu) ui.roundmenu.style.display=''; - if(ui.backgroundMusic) ui.backgroundMusic.play().catch(()=>void 0); + if(ui.backgroundMusic){ + var promise=ui.backgroundMusic.play(); + if(promise) promise.catch(()=>void 0); + } hitsound_audio.remove(); },1000); }; @@ -11368,7 +11372,10 @@ if(dialog){ dialog.close(); } - if(ui.backgroundMusic) ui.backgroundMusic.play().catch(()=>void 0); + if(ui.backgroundMusic){ + var promise=ui.backgroundMusic.play(); + if(promise) promise.catch(()=>void 0); + } },event.videoId,event.time); var result=event.result||result; event.result=result;