crazyhouse only drag pieces on my turn

This commit is contained in:
Thibault Duplessis 2016-01-18 15:47:14 +07:00
parent 3418b3a5f3
commit 846b0e5b8f

View file

@ -4,7 +4,7 @@ var game = require('game').game;
module.exports = function(ctrl, e) {
if (e.button !== 0) return; // only left click
if (!game.isPlayerPlaying(ctrl.data)) return;
if (!game.isPlayerTurn(ctrl.data)) return;
var node = e.target.parentNode.parentNode;
var role = node.getAttribute('data-role'),
color = node.getAttribute('data-color');