diff --git a/server/src/objects/Deck.ts b/server/src/objects/Deck.ts index 528439a..b905ed8 100644 --- a/server/src/objects/Deck.ts +++ b/server/src/objects/Deck.ts @@ -53,6 +53,9 @@ export class Deck { * @param card The card to add to the discard pile */ public discard(card: T) { + if (!this._unknown.includes(card)) { + throw new Error("Cannot discard a card that doesn't exist in the deck"); + }; this._unknown = this._unknown.filter(x => x != card); this._discard.push(card); };