projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix too fast copy-paste from Paco-Sako
[vchess.git]
/
client
/
src
/
variants
/
Dynamo.js
diff --git
a/client/src/variants/Dynamo.js
b/client/src/variants/Dynamo.js
index
b3559c7
..
528f8c1
100644
(file)
--- a/
client/src/variants/Dynamo.js
+++ b/
client/src/variants/Dynamo.js
@@
-771,6
+771,11
@@
export class DynamoRules extends ChessRules {
}
play(move) {
}
play(move) {
+ if (this.subTurn == 1 && move.vanish.length == 0) {
+ // Patch to work with old format: (TODO: remove later)
+ move.ignore = true;
+ return;
+ }
const color = this.turn;
move.subTurn = this.subTurn; //for undo
const gotoNext = (mv) => {
const color = this.turn;
move.subTurn = this.subTurn; //for undo
const gotoNext = (mv) => {
@@
-829,6
+834,7
@@
export class DynamoRules extends ChessRules {
}
undo(move) {
}
undo(move) {
+ if (!!move.ignore) return; //TODO: remove that later
this.disaggregateFlags(JSON.parse(move.flags));
V.UndoOnBoard(this.board, move);
if (this.subTurn == 1) {
this.disaggregateFlags(JSON.parse(move.flags));
V.UndoOnBoard(this.board, move);
if (this.subTurn == 1) {