projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'simu'
[vchess.git]
/
client
/
src
/
variants
/
Suicide.js
diff --git
a/client/src/variants/Suicide.js
b/client/src/variants/Suicide.js
index
ecb2aef
..
e3630bb
100644
(file)
--- a/
client/src/variants/Suicide.js
+++ b/
client/src/variants/Suicide.js
@@
-50,12
+50,11
@@
export class SuicideRules extends ChessRules {
// Stop at the first capture found (if any)
atLeastOneCapture() {
const color = this.turn;
// Stop at the first capture found (if any)
atLeastOneCapture() {
const color = this.turn;
- const oppCol = V.GetOppCol(color);
for (let i = 0; i < V.size.x; i++) {
for (let j = 0; j < V.size.y; j++) {
if (
this.board[i][j] != V.EMPTY &&
for (let i = 0; i < V.size.x; i++) {
for (let j = 0; j < V.size.y; j++) {
if (
this.board[i][j] != V.EMPTY &&
- this.getColor(i, j)
!= oppCol
&&
+ this.getColor(i, j)
== color
&&
this.getPotentialMovesFrom([i, j]).some(m => m.vanish.length == 2)
) {
return true;
this.getPotentialMovesFrom([i, j]).some(m => m.vanish.length == 2)
) {
return true;