Skip to content

Commit 63ca8e7

Browse files
committed
Pacru: Fix click handler and annotation bug
1 parent eed9765 commit 63ca8e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/games/pacru.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ export class PacruGame extends GameBase {
589589
} else {
590590
cells.add(cell);
591591
}
592-
newmove = move.substring(0, idx) + "(" + [...cells].join(",") + ")";
592+
newmove = move.substring(0, idx) + (cells.size > 0 ? "(" + [...cells].join(",") + ")" : "");
593593
} else {
594594
newmove = move + "(" + cell + ")";
595595
}
@@ -1466,8 +1466,9 @@ export class PacruGame extends GameBase {
14661466

14671467
// Add annotations
14681468
if (this.results.length > 0) {
1469+
console.log(JSON.stringify(this.results));
14691470
rep.annotations = [];
1470-
for (const move of this.stack[this.stack.length - 1]._results) {
1471+
for (const move of this.results) {
14711472
if (move.type === "move") {
14721473
const [fromX, fromY] = PacruGame.algebraic2coords(move.from);
14731474
const [toX, toY] = PacruGame.algebraic2coords(move.to);

0 commit comments

Comments
 (0)