X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FYote.js;h=4e53fe912263c25467b82a1e86d44ba782dc2454;hb=b2e8c34e0158f512741d67b8a1c25425e0b8747e;hp=76d7c2e9aa510f89116416e49a9c690ecd5515fd;hpb=cdab566355412821c9187078ee0864ceb30545de;p=vchess.git diff --git a/client/src/variants/Yote.js b/client/src/variants/Yote.js index 76d7c2e9..4e53fe91 100644 --- a/client/src/variants/Yote.js +++ b/client/src/variants/Yote.js @@ -167,8 +167,8 @@ export class YoteRules extends ChessRules { return (x < V.size.x && this.getColor(x, y) != side); } - // TODO: hoverHighlight() would well take an arg "side"... - hoverHighlight(x, y) { + hoverHighlight([x, y], side) { + if (!!side && side != this.turn) return false; const L = this.captures.length; if (!this.captures[L-1]) return false; const oppCol = V.GetOppCol(this.turn); @@ -242,7 +242,7 @@ export class YoteRules extends ChessRules { const mv = this.doClick([x, y]); return (!!mv ? [mv] : []); } - if (x >= V.size.x) return this.getReserveMoves([x, y]); + if (x >= V.size.x) return this.getReserveMoves(x); return this.getPotentialPawnMoves([x, y]); }