Skip to content

Commit fa0bca8

Browse files
committed
Pigs2: I hate all these little commits, but simultaneous games are hard to test offline.
1 parent d90f014 commit fa0bca8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/games/pigs2.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,13 @@ export class Pigs2Game extends GameBaseSimultaneous {
683683
for (let p = 1; p <= this.numplayers; p++) {
684684
const order = this.orders[p-1];
685685
if (Array.isArray(order) && order.length > 0) {
686+
const pieces = order.map(c => cmd2glyph.get(c));
687+
if (pieces.length === 0 || pieces.includes(undefined)) {
688+
continue;
689+
}
686690
areas.push({
687691
type: "pieces",
688-
pieces: order.map(c => cmd2glyph.get(c)!) as [string, ...string[]],
692+
pieces: pieces as [string, ...string[]],
689693
label: i18next.t("apgames:validation.pigs2.LABEL_ORDERS", {playerNum: p}) || `Player ${p}'s orders`,
690694
});
691695
}

0 commit comments

Comments
 (0)