diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-07-18 18:14:23 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-07-18 18:14:23 -0400 |
commit | 19daa4f91a348515af5f9610bd686b5bf4f509ba (patch) | |
tree | 07feb3f5d39b798d347eeeb53bcce5646d86e7d1 | |
parent | 4b408bf19a1ad8ab73626c333245157e71158b2e (diff) |
Fix checking for deck
-rw-r--r-- | scripts/gui/table.js | 6 |
1 files 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(); } |