From 633525a9e56be1fb2f8270c6902b822dde1e61bd Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 18 Mar 2022 19:30:18 +0100 Subject: [PATCH] Fix reset deck in Foundry v9 #9 --- module/actor.js | 2 +- module/sos-card-deck.js | 23 ++++++++++++----------- system.json | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/module/actor.js b/module/actor.js index d1a0d5e..fc3e5d1 100644 --- a/module/actor.js +++ b/module/actor.js @@ -378,7 +378,7 @@ export class SoSActor extends Actor { async addObjectToContainer( itemId, containerId ) { let container = this.data.items.find( item => item.id == containerId && item.type == 'container') let object = this.data.items.find( item => item.id == itemId ) - //console.log("Found", container, object) + console.log("Found", container, object) if ( container ) { if ( object.type == 'container') { ui.notifications.warn("Only 1 level of container... sorry"); diff --git a/module/sos-card-deck.js b/module/sos-card-deck.js index 3f1f3a6..756979f 100644 --- a/module/sos-card-deck.js +++ b/module/sos-card-deck.js @@ -58,21 +58,22 @@ export class SoSCardDeck { /* -------------------------------------------- */ resetDeck() { - let newdeck = duplicate(this.data.deck).concat( duplicate (this.data.discard)); - this.data.discard = []; // Reinit discard pile - this.data.deck = []; - let decklen = newdeck.length; - let cardState = []; + let newdeck = duplicate(this.data.deck).concat( duplicate (this.data.discard) ) + this.data.discard = [] // Reinit discard pile + this.data.deck = [] + let decklen = newdeck.length + let cardState = [] for (let i = 0; i