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:
parent
6dfaaee385
commit
b03c7fd087
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue