Setting of the from square was moved to before OKtoStartUserMove in the
LeftClick handler, to make sure we could test the promotion possiblity
when OnlyMove() would have altered (x,y) to be no longer the from
square. But this setting of fromX, fromY hung on also if the move was
not OK, so you could effectively select opponent pieces and empty
squares. The from-square is now set back to undefined when it is not OK
to move the piece you clicked.
if (appData.highlightDragging) {
SetHighlights(fromX, fromY, -1, -1);
}
- }
+ } else fromX = fromY = -1;
return;
}
}