aboutsummaryrefslogtreecommitdiff
path: root/src/board/engine.rs
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-01-25 09:29:45 +0300
committereug-vs <eugene@eug-vs.xyz>2023-01-25 09:29:45 +0300
commitaabc81cf486d4ffe2696609c0d27e5bfa60c80eb (patch)
treece81b27c7c5b128d4944b5d5f08b7de5e316bf46 /src/board/engine.rs
parent5078f7423c0dd30348b332bdaba0434bb6b5189f (diff)
downloadchessnost-aabc81cf486d4ffe2696609c0d27e5bfa60c80eb.tar.gz
Revert "refactor: return recoverable errors from make_move"
This reverts commit 8dc121b0e08cd25fab3eacde9318d7adaac1f2a4.
Diffstat (limited to 'src/board/engine.rs')
-rw-r--r--src/board/engine.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/board/engine.rs b/src/board/engine.rs
index 88ae77a..d550418 100644
--- a/src/board/engine.rs
+++ b/src/board/engine.rs
@@ -33,7 +33,7 @@ impl Board {
let ep_target_before = self.ep_target.clone();
let castling_rights_before = self.castling_rights.clone();
let hash_before = self.hash.clone();
- let captured_piece = self.make_move(mov).unwrap();
+ let captured_piece = self.make_move(mov);
// King can not be in check after our own move
if !self.is_king_in_check(color) {
if depth == 1 {
@@ -150,10 +150,7 @@ impl Board {
let ep_target_before = self.ep_target.clone();
let castling_rights_before = self.castling_rights.clone();
let hash_before = self.hash.clone();
- let captured_piece = match self.make_move(mov) {
- Ok(piece) => piece,
- Err(err) => panic!("Handle me [{:?}]", err),
- };
+ let captured_piece = self.make_move(mov);
if !self.is_king_in_check(color) {
let (mut score, mut subtree_pv) = self.negamax_search(-beta, -alpha, depth_left - 1, deadline);
@@ -223,7 +220,7 @@ impl Board {
let ep_target_before = self.ep_target.clone();
let castling_rights_before = self.castling_rights.clone();
let hash_before = self.hash.clone();
- let captured_piece = self.make_move(*mov).unwrap();
+ let captured_piece = self.make_move(*mov);
if !self.is_king_in_check(color) {
let evaluation = -self.quiscence(-beta, -alpha);