X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=variants%2FAmbiguous%2Fclass.js;h=db24d0e372ac79cbe341cd23c3934e8a5dff12f8;hp=58458b6a52b80206c01b30d582fc9176b7f6c5c7;hb=f3e90e30b6e7ff416afe288bc9dd865e5daf9860;hpb=a548cb4e3ad8099e977da9bb4a4184973beb56e3 diff --git a/variants/Ambiguous/class.js b/variants/Ambiguous/class.js index 58458b6..db24d0e 100644 --- a/variants/Ambiguous/class.js +++ b/variants/Ambiguous/class.js @@ -149,15 +149,14 @@ export default class AmbiguousRules extends ChessRules { getCurrentScore() { // This function is only called at subTurn 1 const color = C.GetOppCol(this.turn); - const kingPos = this.searchKingPos(color); - if (kingPos[0] < 0) + if (this.searchKingPos(color).length == 0) return (color == 'w' ? "0-1" : "1-0"); return "*"; } postPlay(move) { const color = this.turn; - if (this.subTurn == 2 || this.searchKingPos(color)[0] < 0) { + if (this.subTurn == 2 || this.searchKingPos(color).length == 0) { this.turn = C.GetOppCol(color); this.movesCount++; }