X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=3dde96d8a0c893290124e980ad7c4bfff88129d5;hb=d98150dffc69a810b0b842244aec0d29deddabfb;hp=3ed8ced0326e5ab162f3f70559a1bc80c8a07358;hpb=aa392c366e6b52fa51b4be7965347d867a7f9804;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 3ed8ced0..3dde96d8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -200,7 +200,7 @@ namespace { FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) { // Test for a pawn pushed to 7th or a passed pawn move - if (type_of(pos.piece_on(from_sq(m))) == PAWN) + if (type_of(pos.piece_moved(m)) == PAWN) { Color c = pos.side_to_move(); if ( relative_rank(c, to_sq(m)) == RANK_7 @@ -970,7 +970,7 @@ split_point_start: // At split points actual search starts from here // but fixing this made program slightly weaker. Depth predictedDepth = newDepth - reduction(depth, moveCount); futilityValue = futilityBase + futility_margin(predictedDepth, moveCount) - + H.gain(pos.piece_on(from_sq(move)), to_sq(move)); + + H.gain(pos.piece_moved(move), to_sq(move)); if (futilityValue < beta) { @@ -1154,13 +1154,13 @@ split_point_start: // At split points actual search starts from here // Increase history value of the cut-off move Value bonus = Value(int(depth) * int(depth)); - H.add(pos.piece_on(from_sq(move)), to_sq(move), bonus); + H.add(pos.piece_moved(move), to_sq(move), bonus); // Decrease history of all the other played non-capture moves for (int i = 0; i < playedMoveCount - 1; i++) { Move m = movesSearched[i]; - H.add(pos.piece_on(from_sq(m)), to_sq(m), -bonus); + H.add(pos.piece_moved(m), to_sq(m), -bonus); } } } @@ -1393,7 +1393,7 @@ split_point_start: // At split points actual search starts from here from = from_sq(move); to = to_sq(move); - them = flip(pos.side_to_move()); + them = ~pos.side_to_move(); ksq = pos.king_square(them); kingAtt = pos.attacks_from(ksq); pc = pos.piece_on(from);