X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=src%2Fposition.cpp;h=78fccbb2891d8fb70b1d7e5d406ba985c88daccf;hb=7b0a2f2a90b63d9e5e092786fbfb54cd8ad3d8e5;hp=72681e8d694e68d4c2f709dccf9a54b560aafa06;hpb=17ffc22279b33ef2015a76461e1e644909d43a10;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index 72681e8d..78fccbb2 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1013,7 +1013,7 @@ void Position::undo_null_move() { /// Position::see() is a static exchange evaluator: It tries to estimate the /// material gain or loss resulting from a move. -int Position::see_sign(Move m) const { +Value Position::see_sign(Move m) const { assert(is_ok(m)); @@ -1021,16 +1021,17 @@ int Position::see_sign(Move m) const { // is not less then capturing one. Note that king moves always return // here because king midgame value is set to 0. if (PieceValue[MG][moved_piece(m)] <= PieceValue[MG][piece_on(to_sq(m))]) - return 1; + return VALUE_KNOWN_WIN; return see(m); } -int Position::see(Move m) const { +Value Position::see(Move m) const { Square from, to; Bitboard occupied, attackers, stmAttackers; - int swapList[32], slIndex = 1; + Value swapList[32]; + int slIndex = 1; PieceType captured; Color stm; @@ -1046,7 +1047,7 @@ int Position::see(Move m) const { // handled correctly. Simply return 0 that is always the correct value // unless in the rare case the rook ends up under attack. if (type_of(m) == CASTLING) - return 0; + return VALUE_ZERO; if (type_of(m) == ENPASSANT) {