fix replay when black starts from FEN position
This commit is contained in:
parent
d96ae9535b
commit
e08357af5d
|
@ -56,7 +56,7 @@ module.exports = function(cfg, router, i18n, onChange) {
|
|||
move = moves[ply - 1];
|
||||
hash += move;
|
||||
lm = chess.move(move);
|
||||
var turnColor = ply % 2 === 1 ? 'black' : 'white';
|
||||
var turnColor = chess.turn() == 'w' ? 'white' : 'black';
|
||||
situationCache[hash] = {
|
||||
fen: chess.fen(),
|
||||
turnColor: turnColor,
|
||||
|
|
|
@ -40,7 +40,7 @@ module.exports = function(root) {
|
|||
fen: chess.fen(),
|
||||
check: chess.in_check(),
|
||||
lastMove: [lm.from, lm.to],
|
||||
turnColor: ply % 2 === 0 ? 'white' : 'black'
|
||||
turnColor: chess.turn() == 'w' ? 'white' : 'black'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue