projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo
[xogo.git]
/
app.js
diff --git
a/app.js
b/app.js
index
79aa6e0
..
bb16537
100644
(file)
--- a/
app.js
+++ b/
app.js
@@
-454,10
+454,10
@@
function notifyMe(code) {
let curMoves = [],
lastFen;
let curMoves = [],
lastFen;
-const afterPlay = (move) => {
+const afterPlay = (move
_s
) => {
const callbackAfterSend = () => {
curMoves = [];
const callbackAfterSend = () => {
curMoves = [];
- const result = vr.getCurrentScore(move);
+ const result = vr.getCurrentScore(move
_s
);
if (result != "*") {
setTimeout(() => {
toggleVisible("gameStopped");
if (result != "*") {
setTimeout(() => {
toggleVisible("gameStopped");
@@
-466,7
+466,12
@@
const afterPlay = (move) => {
}
};
// Pack into one moves array, then send
}
};
// Pack into one moves array, then send
- curMoves.push(move);
+ if (Array.isArray(move_s))
+ // Array of simple moves (e.g. Chakart)
+ Array.prototype.push.apply(curMoves, move_s);
+ else
+ // Usual case
+ curMoves.push(move_s);
if (vr.turn != playerColor) {
toggleTurnIndicator(false);
send("newmove",
if (vr.turn != playerColor) {
toggleTurnIndicator(false);
send("newmove",