diff options
-rw-r--r-- | scripts/cards/deck.js | 8 | ||||
-rw-r--r-- | scripts/gui/table.js | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/scripts/cards/deck.js b/scripts/cards/deck.js index 941df8c..0c88821 100644 --- a/scripts/cards/deck.js +++ b/scripts/cards/deck.js @@ -70,17 +70,25 @@ class Deck { appendCard(card) { + if(this.inf) { + return false; + } this.cards.push(card); this.e.appendChild(card.e); this.updatePos(); + return true; } prependCard(card) { + if(this.inf) { + return false; + } this.cards.unshift(card); this.e.prepend(card.e); card.setPos(this.cards.length - 1); this.updateCount(); + return true; } addCardAt(card, index) diff --git a/scripts/gui/table.js b/scripts/gui/table.js index 964f750..232382d 100644 --- a/scripts/gui/table.js +++ b/scripts/gui/table.js @@ -149,7 +149,7 @@ class Table{ if(event.drag.length < 1) return; - var c = this.checkCard(event.drag[0].e); + var c = event.drag[0].e.card; var d = this.checkDeck(event.x, event.y); if(c !== null) |