Some fixes. Screen variant computer play is still broken, seemingly
[vchess.git] / client / src / variants / Synochess.js
index e5c3213..f8e9386 100644 (file)
@@ -344,7 +344,6 @@ export class SynochessRules extends ChessRules {
       let i = x + step[0];
       let j = y + step[1];
       while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) {
-        moves.push(this.getBasicMove([x, y], [i, j]));
         i += step[0];
         j += step[1];
       }
@@ -353,6 +352,7 @@ export class SynochessRules extends ChessRules {
         i += step[0];
         j += step[1];
         while (V.OnBoard(i, j) && this.board[i][j] == V.EMPTY) {
+          moves.push(this.getBasicMove([x, y], [i, j]));
           i += step[0];
           j += step[1];
         }
@@ -527,7 +527,7 @@ export class SynochessRules extends ChessRules {
 
   evalPosition() {
     let evaluation = super.evalPosition();
-    if (this.turn == 'b')
+    if (this.turn == 'b' && !!this.reserve)
       // Add reserves:
       evaluation += this.reserve['b'][V.SOLDIER] * V.VALUES[V.SOLDIER];
     return evaluation;