projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Synchrone2: almost OK (issues with undoing pass moves)
[vchess.git]
/
client
/
src
/
variants
/
Synchrone1.js
diff --git
a/client/src/variants/Synchrone1.js
b/client/src/variants/Synchrone1.js
index
ba9cf9f
..
2c59bc6
100644
(file)
--- a/
client/src/variants/Synchrone1.js
+++ b/
client/src/variants/Synchrone1.js
@@
-399,7
+399,7
@@
export class Synchrone1Rules extends ChessRules {
// Update king position + flags
let kingAppear = { 'w': false, 'b': false };
// Update king position + flags
let kingAppear = { 'w': false, 'b': false };
- for (let i
=0; i<
smove.appear.length; i++) {
+ for (let i
= 0; i <
smove.appear.length; i++) {
if (smove.appear[i].p == V.KING) {
const c = smove.appear[i].c;
kingAppear[c] = true;
if (smove.appear[i].p == V.KING) {
const c = smove.appear[i].c;
kingAppear[c] = true;
@@
-407,7
+407,7
@@
export class Synchrone1Rules extends ChessRules {
this.kingPos[c][1] = smove.appear[i].y;
}
}
this.kingPos[c][1] = smove.appear[i].y;
}
}
- for (let i
=0; i<
smove.vanish.length; i++) {
+ for (let i
= 0; i <
smove.vanish.length; i++) {
if (smove.vanish[i].p == V.KING) {
const c = smove.vanish[i].c;
if (!kingAppear[c]) {
if (smove.vanish[i].p == V.KING) {
const c = smove.vanish[i].c;
if (!kingAppear[c]) {
@@
-434,7
+434,7
@@
export class Synchrone1Rules extends ChessRules {
postUndo(move) {
if (this.turn == 'w') {
postUndo(move) {
if (this.turn == 'w') {
- // Reset king positions: scan board
+ // Reset king positions: scan board
(TODO: could be more efficient)
this.scanKings();
// Also reset whiteMove
this.whiteMove = null;
this.scanKings();
// Also reset whiteMove
this.whiteMove = null;