Adding module with required changes for working replays. May not work.
This commit is contained in:
parent
aea8d3d364
commit
6c182b7652
|
@ -1 +1 @@
|
|||
Subproject commit 38d57536779621be4773a65036c2d0b6b524ff25
|
||||
Subproject commit 558b1104ad5f00de0af356c05083b51fed41dec9
|
|
@ -16,6 +16,12 @@ module.exports = function(root) {
|
|||
|
||||
var situationCache = {};
|
||||
|
||||
var gameVariants = {
|
||||
'chess960' : 1,
|
||||
'antichess': 2,
|
||||
'atomic': 3
|
||||
};
|
||||
|
||||
var showFen = function() {
|
||||
try {
|
||||
var ply, move, cached, fen, hash, h, lm;
|
||||
|
@ -30,9 +36,11 @@ module.exports = function(root) {
|
|||
if (!cached || ply < this.ply) {
|
||||
var variant = root.data.game.variant.key;
|
||||
|
||||
var gameVariantKey = gameVariants[variant] != null ? gameVariants[variant] : 0;
|
||||
|
||||
var chess = new Chess(
|
||||
fen || root.data.game.initialFen,
|
||||
variant == 'chess960' ? 1 : (variant == 'antichess' ? 2 : 0));
|
||||
gameVariantKey);
|
||||
for (ply = ply; ply <= this.ply; ply++) {
|
||||
move = root.data.game.moves[ply - 1];
|
||||
hash += move;
|
||||
|
|
Loading…
Reference in a new issue