diff --git a/js/spniGame.js b/js/spniGame.js index 576831e9d3c77801c019200ea02b7b9127f64f45..a75d384f40f1bd44c9c9905f0fc3eb94773f32f5 100644 --- a/js/spniGame.js +++ b/js/spniGame.js @@ -424,7 +424,7 @@ function startDealPhase () { $gameLabels[i].css({"background-color" : clearColour}); } - timeoutID = window.setTimeout(checkDealLock, (ANIM_DELAY*(players.length))+ANIM_TIME); + timeoutID = window.setTimeout(checkDealLock, ANIM_DELAY * CARDS_PER_HAND * numPlayers + ANIM_TIME); } /************************************************************ @@ -432,15 +432,10 @@ function startDealPhase () { ************************************************************/ function checkDealLock () { /* count the players still in the game */ - var inGame = 0; - for (var i = 0; i < players.length; i++) { - if (players[i] && !players[i].out) { - inGame++; - } - } + var inGame = getNumPlayersInStage(STATUS_ALIVE); /* check the deal lock */ - if (dealLock < inGame * 5) { + if (dealLock < inGame * CARDS_PER_HAND) { timeoutID = window.setTimeout(checkDealLock, 100); } else { gamePhase = eGamePhase.AITURN;