X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.cpp;h=4e2778a946b89a282d83ba51f774d8b21fe2ecee;hp=96f0517f12f223a7558f6f27ef749da6aa22602c;hb=738a6dfd4c71c3ce11d614076117793b4cdf119e;hpb=af6072c8b7e849c43b69dc286bcc0de6d9b453a1 diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 96f0517f..4e2778a9 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -116,7 +116,7 @@ void Bitboards::init() { if (s1 != s2) { SquareDistance[s1][s2] = std::max(distance(s1, s2), distance(s1, s2)); - DistanceRingBB[s1][SquareDistance[s1][s2] - 1] |= s2; + DistanceRingBB[s1][SquareDistance[s1][s2]] |= s2; } int steps[][5] = { {}, { 7, 9 }, { 6, 10, 15, 17 }, {}, {}, {}, { 1, 7, 8, 9 } }; @@ -137,7 +137,7 @@ void Bitboards::init() { } } - Direction RookDirections[] = { NORTH, EAST, SOUTH, WEST }; + Direction RookDirections[] = { NORTH, EAST, SOUTH, WEST }; Direction BishopDirections[] = { NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST }; init_magics(RookTable, RookMagics, RookDirections);