Skip to content

Commit 6d5fb8c

Browse files
committed
Arimaa: More nuanced canrender on empty move
1 parent 149e2eb commit 6d5fb8c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/games/arimaa.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ export class ArimaaGame extends GameBase {
525525
}
526526
}
527527

528-
// console.log(`About to validate ${newmove}`);
528+
console.log(`About to validate '${newmove}'`);
529529
let result = this.validateMove(newmove) as IClickResult;
530530
if (! result.valid) {
531531
result.move = move;
@@ -557,6 +557,11 @@ export class ArimaaGame extends GameBase {
557557
if (m.length === 0) {
558558
result.valid = true;
559559
result.complete = -1;
560+
// if in the setup phase, we need canrender, otherwise don't
561+
result.canrender = false;
562+
if (!this.variants.includes("eee") && this.stack.length <= 2) {
563+
result.canrender = true;
564+
}
560565
result.canrender = true;
561566
result.message = i18next.t("apgames:validation.arimaa.INITIAL_INSTRUCTIONS", {context: (this.hands !== undefined && this.hands[this.currplayer - 1].length > 0) ? "place" : "play"});
562567
return result;
@@ -971,7 +976,7 @@ export class ArimaaGame extends GameBase {
971976
// clear hands when both are empty
972977
if (
973978
(this.hands !== undefined && this.hands[0].length === 0 && this.hands[1].length === 0) ||
974-
(this.variants.includes("free") && this.stack.length ===2)
979+
(this.variants.includes("free") && this.stack.length === 2)
975980
) {
976981
this.hands = undefined;
977982
}

0 commit comments

Comments
 (0)