Commit ae417687 authored by Timothée Giet's avatar Timothée Giet
Browse files

chess, fix moving opponent piece

avoid moving opponent pieces

This fixes a bug that happened if you selected one of your pieces,
and then drag'n'drop an opponent piece on one of the suggested move,
both pieces would move to it.
parent 20883bd0
......@@ -307,7 +307,7 @@ ActivityBase {
chessboard.rotation = 180
}
}
Timer {
id: timerSwap
interval: 1500
......@@ -349,7 +349,7 @@ ActivityBase {
}
}
}
Rectangle {
id: boardBorder
width: items.cellSize * 10
......@@ -428,7 +428,8 @@ ActivityBase {
MouseArea {
id: dragArea
anchors.fill: parent
enabled: !items.gameOver
enabled: !items.gameOver && ((items.blackTurn && !parent.isWhite) || (!items.blackTurn && parent.isWhite))
&& !items.trigComputerMove.running
drag.target: parent
onPressed: {
piece.Drag.keys = ['acceptMe']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment