X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FOmega.js;h=a688a2ea8c36b68359b7a9ceed7b53460717f44f;hp=a4276ed798369e80e0d1c2ca365b90ea76cc2540;hb=723262f9b77ed0f916e5b9fcbfbae5ddfe94925c;hpb=d2a3ec5202c69db3a4d20ca026defb9e21a790f4 diff --git a/client/src/variants/Omega.js b/client/src/variants/Omega.js index a4276ed7..a688a2ea 100644 --- a/client/src/variants/Omega.js +++ b/client/src/variants/Omega.js @@ -309,18 +309,12 @@ export class OmegaRules extends ChessRules { return moves; } - addPawnMoves([x1, y1], [x2, y2], moves, promotions) { - let finalPieces = [V.PAWN]; + addPawnMoves([x1, y1], [x2, y2], moves) { const color = this.turn; const lastRank = (color == "w" ? 1 : V.size.x - 2); - if (x2 == lastRank) { - // promotions arg: special override for Hiddenqueen variant - if (!!promotions) finalPieces = promotions; - else if (!!V.PawnSpecs.promotions) finalPieces = V.PawnSpecs.promotions; - } - let tr = null; + const finalPieces = (x2 == lastRank ? V.PawnSpecs.promotions : [V.PAWN]); for (let piece of finalPieces) { - tr = (piece != V.PAWN ? { c: color, p: piece } : null); + const tr = (piece != V.PAWN ? { c: color, p: piece } : null); moves.push(this.getBasicMove([x1, y1], [x2, y2], tr)); } }