crazyhouse only drag pieces on my turn
This commit is contained in:
parent
3418b3a5f3
commit
846b0e5b8f
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue