diff --git a/game/game.js b/game/game.js index c51be2580..618fe9078 100644 --- a/game/game.js +++ b/game/game.js @@ -24770,18 +24770,7 @@ game.showHistory(); ui.create.players(num); ui.create.me(); - if(lib.onfree){ - _status.waitingForCards=true; - lib.onfree.push(function(){ - if(_status.waitingForCards){ - ui.create.cards(); - delete _status.waitingForCards; - } - }); - } - else{ - ui.create.cards(); - } + ui.create.cardsAsync(); game.finishCards(); }, clearArena:function(){ @@ -34268,16 +34257,30 @@ } return node; }, - cards:function(random){ + cardsAsync:function(){ + if(lib.onfree){ + _status.waitingForCards=Array.from(arguments); + lib.onfree.push(function(){ + if(_status.waitingForCards){ + ui.create.cards.apply(ui.create,_status.waitingForCards); + delete _status.waitingForCards; + } + }); + } + else{ + ui.create.cards.apply(ui.create,arguments); + } + }, + cards:function(ordered){ if(_status.brawl){ if(_status.brawl.cardPile){ lib.card.list=_status.brawl.cardPile(lib.card.list); } if(_status.brawl.orderedPile){ - random=true; + ordered=true; } } - if(!random){ + if(!ordered){ lib.card.list.randomSort(); } for(var i=0;i