X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=91fe7ab4506d9b11c85f626412dbf2be38ae77a0;hp=8f70b5dfd3ab3af4c644072396622c75257ce381;hb=89ec224cb92f49a6edc3d8b03a43d1c4418c285a;hpb=b21a5e2f0638a55daeaa98ba95afc6c016ea0b6e diff --git a/src/position.cpp b/src/position.cpp index 8f70b5df..91fe7ab4 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -208,7 +208,7 @@ void Position::from_fen(const string& fen, bool isChess960) { if ( ((ss >> col) && (col >= 'a' && col <= 'h')) && ((ss >> row) && (row == '3' || row == '6'))) { - st->epSquare = make_square(file_from_char(col), rank_from_char(row)); + st->epSquare = make_square(File(col - 'a') + FILE_A, Rank(row - '1') + RANK_1); // Ignore if no capture is possible Color them = opposite_color(sideToMove); @@ -1913,7 +1913,7 @@ bool Position::is_ok(int* failedStep) const { if (failedStep) *failedStep = 1; // Side to move OK? - if (!color_is_ok(side_to_move())) + if (side_to_move() != WHITE && side_to_move() != BLACK) return false; // Are the king squares in the position correct? @@ -1927,10 +1927,10 @@ bool Position::is_ok(int* failedStep) const { // Castle files OK? if (failedStep) (*failedStep)++; - if (!file_is_ok(initialKRFile)) + if (!square_is_ok(make_square(initialKRFile, RANK_1))) return false; - if (!file_is_ok(initialQRFile)) + if (!square_is_ok(make_square(initialQRFile, RANK_1))) return false; // Do both sides have exactly one king?