mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Test killer for legality earlier
Many killers moves, around 40%, are not legal, so skip earlier in this case. Some Movepicker c'tor cleanup while there. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
4e7a898d7e
commit
dc5caff638
1 changed files with 7 additions and 6 deletions
|
@ -70,12 +70,12 @@ namespace {
|
|||
/// search captures, promotions and some checks) and about how important good
|
||||
/// move ordering is at the current node.
|
||||
|
||||
MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
||||
const History& h, SearchStack* ss, Value beta) : pos(p), H(h) {
|
||||
MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
|
||||
SearchStack* ss, Value beta) : pos(p), H(h) {
|
||||
int searchTT = ttm;
|
||||
ttMoves[0].move = ttm;
|
||||
lastBadCapture = badCaptures;
|
||||
badCaptureThreshold = 0;
|
||||
lastBadCapture = badCaptures;
|
||||
|
||||
pinned = p.pinned_pieces(pos.side_to_move());
|
||||
|
||||
|
@ -98,7 +98,8 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
|||
badCaptureThreshold = -PawnValueMidgame;
|
||||
|
||||
phasePtr = MainSearchPhaseTable;
|
||||
} else if (d == Depth(0))
|
||||
}
|
||||
else if (d == Depth(0))
|
||||
phasePtr = QsearchWithChecksPhaseTable;
|
||||
else
|
||||
{
|
||||
|
@ -312,9 +313,9 @@ Move MovePicker::get_next_move() {
|
|||
case PH_KILLERS:
|
||||
move = (curMove++)->move;
|
||||
if ( move != MOVE_NONE
|
||||
&& move_is_legal(pos, move, pinned)
|
||||
&& move != ttMoves[0].move
|
||||
&& move != ttMoves[1].move
|
||||
&& move_is_legal(pos, move, pinned)
|
||||
&& !pos.move_is_capture(move))
|
||||
return move;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue