Skip to content

Commit 7c01a0b

Browse files
committed
fix another crash with trash finesses
1 parent 62647e1 commit 7c01a0b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/conventions/h-group/clue-interpretation/interpret-clue.js

+2
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,8 @@ export function interpret_clue(game, action) {
783783
if (p === state.ourPlayerIndex)
784784
continue;
785785
const first_unclued = state.hands[p].sort((a, b) => b-a).filter(c => !state.deck[c].clued)[0];
786+
if (first_unclued === undefined)
787+
continue;
786788
// the leftmost unclued card is either the same color as the clue, or the same rank, and is playable
787789
if (((clue.type === CLUE.COLOUR && state.deck[first_unclued].suitIndex === clue.value) ||
788790
clue.type === CLUE.RANK && state.deck[first_unclued].rank === clue.value) && !state.isBasicTrash(state.deck[first_unclued]))

0 commit comments

Comments
 (0)