projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Typos
[vchess.git]
/
client
/
src
/
variants
/
Bishopawns.js
diff --git
a/client/src/variants/Bishopawns.js
b/client/src/variants/Bishopawns.js
index
1ee9b97
..
feecd45
100644
(file)
--- a/
client/src/variants/Bishopawns.js
+++ b/
client/src/variants/Bishopawns.js
@@
-1,6
+1,7
@@
import { ChessRules } from "@/base_rules";
export class BishopawnsRules extends ChessRules {
import { ChessRules } from "@/base_rules";
export class BishopawnsRules extends ChessRules {
+
static get PawnSpecs() {
return Object.assign(
{},
static get PawnSpecs() {
return Object.assign(
{},
@@
-36,8
+37,12
@@
export class BishopawnsRules extends ChessRules {
}
// Did a black pawn promote? Can the bishop take it?
const qIdx = this.board[7].findIndex(cell => cell[1] == V.QUEEN);
}
// Did a black pawn promote? Can the bishop take it?
const qIdx = this.board[7].findIndex(cell => cell[1] == V.QUEEN);
- if (qIdx >= 0 && !super.isAttackedByBishop([7, qIdx], 'w'))
+ if (
+ qIdx >= 0 &&
+ (this.turn == 'b' || !super.isAttackedByBishop([7, qIdx], 'w'))
+ ) {
return "0-1";
return "0-1";
+ }
if (!this.atLeastOneMove()) return "1/2";
return "*";
}
if (!this.atLeastOneMove()) return "1/2";
return "*";
}
@@
-48,4
+53,5
@@
export class BishopawnsRules extends ChessRules {
static get SEARCH_DEPTH() {
return 4;
}
static get SEARCH_DEPTH() {
return 4;
}
+
};
};