Skip to content

Commit bf61d83

Browse files
committed
fix crash related to TOCMs
1 parent 1eb7810 commit bf61d83

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/conventions/h-group/take-action.js

+4
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,8 @@ export async function take_action(game) {
614614
if (trash_orders.length >= 2 && game.level >= LEVEL.TRASH_PUSH) {
615615
for (let i = 1; i < trash_orders.length; i++) {
616616
const next_chop = me.chop(state.hands[player_check_index]);
617+
if (next_chop === undefined)
618+
continue;
617619
const chop_value = cardValue(state, me, state.deck[next_chop], next_chop);
618620
const new_chop_value = me.withThoughts(next_chop, (draft) => { draft.chop_moved = true; }).chopValue(state, nextPlayerIndex);
619621
if (new_chop_value < chop_value && chop_value >= 1)
@@ -717,6 +719,8 @@ export async function take_action(game) {
717719
if (trash_orders.length >= 2 && game.level >= LEVEL.TRASH_PUSH) {
718720
for (let i = 1; i < trash_orders.length; i++) {
719721
const next_chop = me.chop(state.hands[player_check_index]);
722+
if (next_chop === undefined)
723+
continue;
720724
const chop_value = cardValue(state, me, state.deck[next_chop], next_chop);
721725
const new_chop_value = me.withThoughts(next_chop, (draft) => { draft.chop_moved = true; }).chopValue(state, nextPlayerIndex);
722726
if (new_chop_value < chop_value && chop_value >= 1)

0 commit comments

Comments
 (0)