From 4f1dd2610c57274651b3dc2a307904dfaa1d0c43 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Thu, 24 Aug 2023 21:07:23 -0700 Subject: [PATCH] Optimize game.asyncDrawAuto. (cherry picked from commit 2bcbcf881b5a92d72584b27204f8b5b4729de1b9) --- game/game.js | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/game/game.js b/game/game.js index 94cd12c15..4569b937b 100644 --- a/game/game.js +++ b/game/game.js @@ -37453,27 +37453,16 @@ } }, asyncDrawAuto:function(players,num,drawDeck){ - if(players.length==1){ - var num2=1; - if(typeof num=='number'){ - num2=num; - } - else if(Array.isArray(num)){ - num2=num[0]; - } - else if(typeof num=='function'){ - num2=num(players[0]); - } - if(drawDeck&&drawDeck.drawDeck){ - players[0].draw(num2,drawDeck); - } - else{ - players[0].draw(num2); - } - } - else{ + if(players.length>1){ game.asyncDraw.apply(this,arguments); + return; } + let num2=1; + if(typeof num=='number') num2=num; + else if(Array.isArray(num)) num2=num[0]; + else if(typeof num=='function') num2=num(players[0]); + if(drawDeck&&drawDeck.drawDeck) players[0].draw(num2,drawDeck); + else players[0].draw(num2); }, finishSkill:(i,sub)=>{ const mode=get.mode(),info=lib.skill[i],iInfo=`${i}_info`;