delay premove by 10ms

pull/595/head
Thibault Duplessis 2015-06-17 18:48:37 +02:00
parent 00de4a5eb6
commit 3e98d225dc
1 changed files with 7 additions and 7 deletions

View File

@ -169,13 +169,6 @@ module.exports = function(opts) {
},
check: o.check
});
if (playedColor !== d.player.color) {
// atrocious hack to prevent race condition
// with explosions and premoves
// https://github.com/ornicar/lila/issues/343
if (d.game.variant.key === 'atomic') setTimeout(this.chessground.playPremove, 100);
else this.chessground.playPremove();
}
}
if (o.clock) {
var c = o.clock
@ -194,6 +187,13 @@ module.exports = function(opts) {
m.endComputation();
if (d.blind) blind.reload(this);
if (game.isPlayerPlaying(d) && playedColor === d.player.color) this.moveOn.next();
if (!this.replaying() && playedColor !== d.player.color) {
// atrocious hack to prevent race condition
// with explosions and premoves
// https://github.com/ornicar/lila/issues/343
setTimeout(this.chessground.playPremove, d.game.variant.key === 'atomic' ? 100 : 10);
}
}.bind(this);
this.reload = function(cfg) {