X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=a67d04f6b1825ca3977f2bc57e6773e045e03eaa;hp=14490cdd4729c6a55632e3d3ac861509b779679d;hb=822695d4d3a9336dc54bfabd0996e75865358ae2;hpb=2acda1fde3e1542a0b1bfc5a0885559e6daf142a diff --git a/src/position.cpp b/src/position.cpp index 14490cdd..a67d04f6 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -211,10 +211,10 @@ Position& Position::set(const string& fenStr, bool isChess960, StateInfo* si, Th while ((ss >> token) && !isspace(token)) { if (isdigit(token)) - sq += Square(token - '0'); // Advance the given number of files + sq += (token - '0') * EAST; // Advance the given number of files else if (token == '/') - sq -= Square(16); + sq += 2 * SOUTH; else if ((idx = PieceToChar.find(token)) != string::npos) { @@ -787,7 +787,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { if ( (int(to) ^ int(from)) == 16 && (attacks_from(to - pawn_push(us), us) & pieces(them, PAWN))) { - st->epSquare = (from + to) / 2; + st->epSquare = to - pawn_push(us); k ^= Zobrist::enpassant[file_of(st->epSquare)]; }