The pointers were compared, in stead of the values.
Furthermore, instead of null moves, it rejected moves on the main diagonal when legality checking was off.
Also exclude moves with empty squares and enemy pieces.
if (appData.testLegality) {
return (*moveType != IllegalMove);
} else {
- return !(fromX == fromY && toX == toY);
+ return !(*fromX == *toX && *fromY == *toY) && boards[moveNum][*fromY][*fromX] != EmptySquare &&
+ WhiteOnMove(moveNum) == (boards[moveNum][*fromY][*fromX] < BlackPawn);
}
case WhiteDrop: