Add a stateful «turnCard» variable like «selected» to fix the «double card» bug when choosing a card in the river after a Turned card step

This commit is contained in:
Tissevert 2019-10-18 19:01:13 +02:00
parent 6dfaaee385
commit b03c7fd087

View file

@ -9,6 +9,7 @@ function Game(modules) {
}; };
var sets = buildSets(); var sets = buildSets();
var selected = null; var selected = null;
var turnedCard = null;
var queue = []; var queue = [];
function buildSets() { function buildSets() {
@ -174,7 +175,8 @@ function Game(modules) {
movingCards.push([sets[side].hand, dest, card]); movingCards.push([sets[side].hand, dest, card]);
} else { } else {
var cardSet = {}; var cardSet = {};
cardSet[card.name] = new TurnedCard(card.name); cardSet[card.name] = turnedCard || new TurnedCard(card.name);
turnedCard = null;
movingCards.push([{card: cardSet, dom: deck}, dest, card]); movingCards.push([{card: cardSet, dom: deck}, dest, card]);
} }
return movingCards; return movingCards;