X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=3526a3d023a5ef38a9e214193bb15820cd30f780;hp=0c81763155d078275263430b17b4a044269daeab;hb=a6c5b4c6fbd1db45377f9dfecd361cebffe27a8d;hpb=0504a6975d8f32ee9638e05b53ed32e3f7a7f4e1 diff --git a/src/position.cpp b/src/position.cpp index 0c817631..3526a3d0 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1136,7 +1136,7 @@ int Position::see_sign(Move m) const { // Early return if SEE cannot be negative because captured piece value // is not less then capturing one. Note that king moves always return // here because king midgame value is set to 0. - if (PieceValue[MG][piece_on(to_sq(m))] >= PieceValue[MG][piece_moved(m)]) + if (PieceValue[MG][piece_moved(m)] <= PieceValue[MG][piece_on(to_sq(m))]) return 1; return see(m); @@ -1197,6 +1197,12 @@ int Position::see(Move m, int asymmThreshold) const { do { assert(slIndex < 32); + if (captured == KING) // Stop before processing a king capture + { + swapList[slIndex++] = QueenValueMg * 16; + break; + } + // Add the new entry to the swap list swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured]; slIndex++; @@ -1206,15 +1212,6 @@ int Position::see(Move m, int asymmThreshold) const { stm = ~stm; stmAttackers = attackers & pieces(stm); - if (captured == KING) - { - // Stop before processing a king capture - if (stmAttackers) - swapList[slIndex++] = QueenValueMg * 16; - - break; - } - } while (stmAttackers); // If we are doing asymmetric SEE evaluation and the same side does the first