Adding module with required changes for working replays. May not work.

This commit is contained in:
Gordon Martin 2015-01-06 22:44:37 +00:00
parent aea8d3d364
commit 6c182b7652
2 changed files with 10 additions and 2 deletions

@ -1 +1 @@
Subproject commit 38d57536779621be4773a65036c2d0b6b524ff25
Subproject commit 558b1104ad5f00de0af356c05083b51fed41dec9

View file

@ -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;