Dragging an EmptySquare off board will make it a DarkSquare. Dragging
anything else off board (incl. DarkSquares) makes it empty, as before.
/* EditPosition, empty square, or different color piece;
click-click move is possible */
if (toX == -2 || toY == -2) {
- boards[0][fromY][fromX] = EmptySquare;
+ boards[0][fromY][fromX] = (boards[0][fromY][fromX] == EmptySquare ? DarkSquare : EmptySquare);
DrawPosition(FALSE, boards[currentMove]);
return;
} else if (toX >= 0 && toY >= 0) {