From 19daa4f91a348515af5f9610bd686b5bf4f509ba Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Mon, 18 Jul 2022 18:14:23 -0400 Subject: Fix checking for deck --- scripts/gui/table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/gui/table.js b/scripts/gui/table.js index 232382d..5e69f3e 100644 --- a/scripts/gui/table.js +++ b/scripts/gui/table.js @@ -120,9 +120,9 @@ class Table{ // Check if a position is within a deck checkDeck(x, y) { - for(let d of this.decks) + for(let d of Object.keys(this.decks)) { - if(d.isInside(x, y)) + if(this.decks[d].isInside(x, y)) return d; } return null; @@ -155,7 +155,7 @@ class Table{ if(c !== null) { if(d !== null) - this.checkMove(c.getID(), d.getID()); + this.checkMove(c.getID(), d); else c.resetPos(); } -- cgit v1.2.3