mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Better document how history works
Both with added comment and changing the API to reflect that only destination square and moved piece is important for history. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -2332,7 +2332,7 @@ namespace {
|
||||
return false;
|
||||
|
||||
// Case 4: Don't prune moves with good history.
|
||||
if (!H.ok_to_prune(pos.piece_on(move_from(m)), m, d))
|
||||
if (!H.ok_to_prune(pos.piece_on(mfrom), mto, d))
|
||||
return false;
|
||||
|
||||
// Case 5: If the moving piece in the threatened move is a slider, don't
|
||||
@@ -2379,13 +2379,13 @@ namespace {
|
||||
void update_history(const Position& pos, Move m, Depth depth,
|
||||
Move movesSearched[], int moveCount) {
|
||||
|
||||
H.success(pos.piece_on(move_from(m)), m, depth);
|
||||
H.success(pos.piece_on(move_from(m)), move_to(m), depth);
|
||||
|
||||
for (int i = 0; i < moveCount - 1; i++)
|
||||
{
|
||||
assert(m != movesSearched[i]);
|
||||
if (ok_to_history(pos, movesSearched[i]))
|
||||
H.failure(pos.piece_on(move_from(movesSearched[i])), movesSearched[i]);
|
||||
H.failure(pos.piece_on(move_from(movesSearched[i])), move_to(movesSearched[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user