aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-30 22:33:06 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-30 22:33:06 +0300
commit7849b36891ccf709a11f311c5bb84cb1466b991a (patch)
tree02cd5d203044c1823d6c29e20387591d6bc58edb /src
parent36752fe3fbec5ad2bc849630706fbd9781075204 (diff)
downloadchessnost-7849b36891ccf709a11f311c5bb84cb1466b991a.tar.gz
fix: do not account queen in mobility correclty
Diffstat (limited to 'src')
-rw-r--r--src/board/engine.rs6
-rw-r--r--src/board/mod.rs5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs
index 3caa18b..e951178 100644
--- a/src/board/engine.rs
+++ b/src/board/engine.rs
@@ -412,7 +412,11 @@ impl Board {
let mut moves = self.generate_pseudolegal_moves(color);
moves = self.order_moves(moves, Vec::new());
- let stand_pat = self.evaluate(Some(moves.len() as f32));
+ let queen_squares = match color {
+ Color::White => self.pieces[PieceType::Queen as usize],
+ Color::Black => self.pieces[PieceType::QueenBlack as usize],
+ };
+ let stand_pat = self.evaluate(Some(moves.iter().filter(|m| m.source.to_bitboard() & queen_squares == 0).count() as f32));
if stand_pat >= beta {
return beta;
diff --git a/src/board/mod.rs b/src/board/mod.rs
index f710057..8d12a12 100644
--- a/src/board/mod.rs
+++ b/src/board/mod.rs
@@ -519,10 +519,7 @@ impl Board {
}
}
PieceType::Queen => {
- for source in serialize_bitboard(*piece) {
- // Scale down mobility because we don't want our queen to be rushing too much
- mobility += pop_count(self.attacks.queen(self.occupancy, source) & (empty | opponent_occupancy)) as f32 / 3.0;
- }
+ // Do not account queen in mobility
}
incorrect_type => panic!("Incorrect piece type: {:?}", incorrect_type),
}