projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Koopa promotions after stunning pieces
[vchess.git]
/
client
/
src
/
variants
/
Koopa.js
diff --git
a/client/src/variants/Koopa.js
b/client/src/variants/Koopa.js
index
3f2e855
..
c7b0859
100644
(file)
--- a/
client/src/variants/Koopa.js
+++ b/
client/src/variants/Koopa.js
@@
-184,7
+184,10
@@
export class KoopaRules extends ChessRules {
m.appear[0].x = i;
m.appear[0].y = j;
// Is it a pawn on last rank?
m.appear[0].x = i;
m.appear[0].y = j;
// Is it a pawn on last rank?
- if ((color == 'w' && i == 0) || (color == 'b' && i == 7)) {
+ if (
+ m.appear[0].p == V.PAWN &&
+ ((color == 'w' && i == 0) || (color == 'b' && i == 7))
+ ) {
m.appear[0].p = V.ROOK;
for (let ppiece of [V.KNIGHT, V.BISHOP, V.QUEEN]) {
let mp = JSON.parse(JSON.stringify(m));
m.appear[0].p = V.ROOK;
for (let ppiece of [V.KNIGHT, V.BISHOP, V.QUEEN]) {
let mp = JSON.parse(JSON.stringify(m));