Insantiating Chess with the right game_mode parameter. There might be

more places that it is constructed that need updated as well.
This commit is contained in:
Gordon Martin 2015-01-09 13:24:22 +00:00
parent 8139430d12
commit 757ec539f3

View file

@ -38,6 +38,13 @@ module.exports = function(cfg, router, i18n, onChange) {
}.bind(this);
var situationCache = {};
var gameVariants = {
'chess960' : 1,
'antichess': 2,
'atomic': 3
};
var showGround = function() {
var moves;
try {
@ -51,9 +58,11 @@ module.exports = function(cfg, router, i18n, onChange) {
h = '',
lm;
if (nbMoves == 0) {
var variant = this.data.game.variant.key;
var chess = new Chess(
this.data.game.initialFen,
is960() ? 1 : (isAntichess() ? 2 : 0));
gameVariants[variant] == null ? 0 : gameVariants[variant]);
var turnColor = chess.turn() == 'w' ? 'white' : 'black';
this.vm.situation = {
fen: this.data.game.initialFen,