1
0

Fix #107 -- filter cards to only included unplayed

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-05-02 18:51:21 -07:00
parent 3d8226a3e8
commit 6779a8ac26

View File

@ -2195,7 +2195,10 @@ const playCard = (game, session, card) => {
return `Robber is in action. You can not play a card until all Robber tasks are resolved.`; return `Robber is in action. You can not play a card until all Robber tasks are resolved.`;
} }
card = player.development.find(item => item.type == card.type && item.card == card.card); card = player.development.find(
item => item.type == card.type
&& item.card == card.card
&& !card.played);
if (!card) { if (!card) {
return `The card you want to play was not found in your hand!`; return `The card you want to play was not found in your hand!`;
} }
@ -2204,10 +2207,6 @@ const playCard = (game, session, card) => {
return `You can only play one development card per turn!`; return `You can only play one development card per turn!`;
} }
if (card.played) {
return `You have already played this card.`;
}
/* Check if this is a victory point */ /* Check if this is a victory point */
if (card.type === 'vp') { if (card.type === 'vp') {
let points = player.points; let points = player.points;