mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Include castle moves in 'dangerous' flag
Simplifies the code and seems more natural. We have a very small fucntional change becuase now at PV nodes castles are extended one ply anyhow. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
5dc0df8435
commit
9dbda6652e
1 changed files with 6 additions and 4 deletions
|
@ -171,12 +171,16 @@ namespace {
|
||||||
// 'dangerous' moves so that we avoid to prune it.
|
// 'dangerous' moves so that we avoid to prune it.
|
||||||
FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) {
|
FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) {
|
||||||
|
|
||||||
// Test for a passed pawn move
|
// Castle move?
|
||||||
|
if (type_of(m) == CASTLE)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Passed pawn move?
|
||||||
if ( type_of(pos.piece_moved(m)) == PAWN
|
if ( type_of(pos.piece_moved(m)) == PAWN
|
||||||
&& pos.pawn_is_passed(pos.side_to_move(), to_sq(m)))
|
&& pos.pawn_is_passed(pos.side_to_move(), to_sq(m)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Test for a capture that triggers a pawn endgame
|
// Entering a pawn endgame?
|
||||||
if ( captureOrPromotion
|
if ( captureOrPromotion
|
||||||
&& type_of(pos.piece_on(to_sq(m))) != PAWN
|
&& type_of(pos.piece_on(to_sq(m))) != PAWN
|
||||||
&& type_of(m) == NORMAL
|
&& type_of(m) == NORMAL
|
||||||
|
@ -897,7 +901,6 @@ split_point_start: // At split points actual search starts from here
|
||||||
&& !inCheck
|
&& !inCheck
|
||||||
&& !dangerous
|
&& !dangerous
|
||||||
&& move != ttMove
|
&& move != ttMove
|
||||||
&& type_of(move) != CASTLE
|
|
||||||
&& (bestValue > VALUE_MATED_IN_MAX_PLY || bestValue == -VALUE_INFINITE))
|
&& (bestValue > VALUE_MATED_IN_MAX_PLY || bestValue == -VALUE_INFINITE))
|
||||||
{
|
{
|
||||||
// Move count based pruning
|
// Move count based pruning
|
||||||
|
@ -956,7 +959,6 @@ split_point_start: // At split points actual search starts from here
|
||||||
&& !isPvMove
|
&& !isPvMove
|
||||||
&& !captureOrPromotion
|
&& !captureOrPromotion
|
||||||
&& !dangerous
|
&& !dangerous
|
||||||
&& type_of(move) != CASTLE
|
|
||||||
&& ss->killers[0] != move
|
&& ss->killers[0] != move
|
||||||
&& ss->killers[1] != move)
|
&& ss->killers[1] != move)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue