projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Copycat, reduce Bario image size
[vchess.git]
/
client
/
src
/
variants
/
Omega.js
diff --git
a/client/src/variants/Omega.js
b/client/src/variants/Omega.js
index
a4276ed
..
a688a2e
100644
(file)
--- a/
client/src/variants/Omega.js
+++ b/
client/src/variants/Omega.js
@@
-309,18
+309,12
@@
export class OmegaRules extends ChessRules {
return moves;
}
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);
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) {
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));
}
}
moves.push(this.getBasicMove([x1, y1], [x2, y2], tr));
}
}