This commit is contained in:
Thibault Duplessis 2015-05-07 09:42:05 +02:00
parent 4bc5cb6918
commit 44d3badcf7
3 changed files with 4 additions and 4 deletions

View file

@ -2130,7 +2130,7 @@ lichess.storage = {
name: "analyse"
},
params: {
ran: "--ranph--",
ran: "--ranph--"
},
receive: function(t, d) {
analyse.socketReceive(t, d);

View file

@ -38,9 +38,10 @@ module.exports = function(steps, analysis) {
});
if (curStep) {
curStep.variations = curStep.variations || [];
if (curStep.san === step.san) return false;;
if (curStep.san === step.san) return nextPath;
for (var i = 0; i < curStep.variations.length; i++) {
if (curStep.variations[i][0].san === step.san) return false;
if (curStep.variations[i][0].san === step.san)
return treePath.withVariation(nextPath, i + 1);
}
curStep.variations.push([step]);
return treePath.withVariation(nextPath, curStep.variations.length);

View file

@ -127,7 +127,6 @@ module.exports = function(opts) {
this.addStep = function(step, path) {
var newPath = this.analyse.addStep(step, treePath.read(path));
if (!newPath) return;
this.jump(newPath);
m.redraw();
this.chessground.playPremove();