X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FShogi.js;h=f684a2791c18baf30268640d0eeacda6e26a99e8;hb=edfb07b1a6ad225a3a01e205ceb69c0bcff6a377;hp=7e827bc2ebbd9fac256768cd193553dd0ddd0743;hpb=0b9a6ff95fb80a9f40077e6554c420626a1e0454;p=vchess.git diff --git a/client/src/variants/Shogi.js b/client/src/variants/Shogi.js index 7e827bc2..f684a279 100644 --- a/client/src/variants/Shogi.js +++ b/client/src/variants/Shogi.js @@ -114,7 +114,7 @@ export class ShogiRules extends ChessRules { let counts = new Array(14); for (let i = 0; i < V.RESERVE_PIECES.length; i++) { counts[i] = this.reserve["w"][V.RESERVE_PIECES[i]]; - counts[6 + i] = this.reserve["b"][V.RESERVE_PIECES[i]]; + counts[7 + i] = this.reserve["b"][V.RESERVE_PIECES[i]]; } return counts.join(""); } @@ -268,7 +268,7 @@ export class ShogiRules extends ChessRules { // Modified to take promotions into account getSlideNJumpMoves([x, y], steps, options) { - const options = options || {}; + options = options || {}; const color = this.turn; const oneStep = options.oneStep; const forcePromoteOnLastRank = options.force; @@ -466,7 +466,7 @@ export class ShogiRules extends ChessRules { return ( this.isAttackedBySlideNJump(sq, color, V.P_ROOK, V.steps[V.ROOK]) || this.isAttackedBySlideNJump( - sq, color, V.DRAGON, V.steps[V.BISHOP], "oneStep") + sq, color, V.P_ROOK, V.steps[V.BISHOP], "oneStep") ); } @@ -474,7 +474,7 @@ export class ShogiRules extends ChessRules { return ( this.isAttackedBySlideNJump(sq, color, V.P_BISHOP, V.steps[V.BISHOP]) || this.isAttackedBySlideNJump( - sq, color, V.DRAGON, V.steps[V.ROOK], "oneStep") + sq, color, V.P_BISHOP, V.steps[V.ROOK], "oneStep") ); }