Skip to content

Commit 17f14ad

Browse files
committed
Arimaa: No placing enemy pieces
1 parent c6bb4ce commit 17f14ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/games/arimaa.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,13 +843,13 @@ export class ArimaaGame extends GameBase {
843843
// placement
844844
if (this.hands !== undefined && this.hands[this.currplayer - 1].length > 0) {
845845
if (from !== undefined) {
846-
this.board.set(from, [pc, owner]);
846+
this.board.set(from, [pc, this.currplayer]);
847847
this.results.push({type: "place", what: pc, where: from});
848848
// update hand
849849
if (!this.variants.includes("free")) {
850850
this.hands![this.currplayer - 1].splice(this.hands![this.currplayer - 1].indexOf(pc), 1);
851851
}
852-
lastmove.push(`${owner === 1 ? pc : pc.toLowerCase()}${from}`);
852+
lastmove.push(`${this.currplayer === 1 ? pc : pc.toLowerCase()}${from}`);
853853
} else if (i !== steps.length - 1) {
854854
throw new Error("Invalid placement detected in the middle of the move.");
855855
}

0 commit comments

Comments
 (0)