Skip to content

Commit 859153c

Browse files
committed
fix another crash
1 parent c1593db commit 859153c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,14 @@ export function interpret_clue(game, action) {
618618
last_possible_player = p;
619619
}
620620
// if no one else has the card, we have it
621-
if (last_possible_player == -1)
621+
if (last_possible_player === -1) {
622+
if (giver === game.me.playerIndex) {
623+
game.interpretMove(CLUE_INTERP.MISTAKE);
624+
team_elim(game);
625+
return game;
626+
}
622627
last_possible_player = game.me.playerIndex;
628+
}
623629
// Mark it as finessed
624630
const { possible } = common.thoughts[state.hands[last_possible_player].sort((a, b) => b-a).filter(c => !state.deck[c].clued)[0]];
625631
const new_inferred = possible.intersect(possible.filter(i => state.isBasicTrash(i)));
@@ -1150,6 +1156,11 @@ function interpret_trash_finesse(game, action, focus_order) {
11501156
focus_thoughts.inferred.every(i => state.isPlayable(i) && !isTrash(state, mod_common, i, focus_order, { infer: true }) && !state.isPlayable(i))) {
11511157
return [];
11521158
}
1159+
// check if all new cards are actually trash
1160+
for (const order of list) {
1161+
if (state.deck[order].newly_clued && !isTrash(state, mod_common, state.deck[order].identity, order, { infer: true }))
1162+
return [];
1163+
}
11531164

11541165
const oldest_trash_index = state.hands[target].findLastIndex(o => state.deck[o].newly_clued);
11551166

0 commit comments

Comments
 (0)