From 6aefcd16485b968f4de8532a36bba90ff11187bd Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Thu, 22 Apr 2021 22:33:39 +0200 Subject: [PATCH] Speed up pocket evaluation crazyhouse STC ELO: 23.77 +-6.7 (95%) LOS: 100.0% Total: 10000 W: 5176 L: 4493 D: 331 No functional change. --- src/evaluate.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f09f4ca..23804b9 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -628,7 +628,7 @@ namespace { Score score = SCORE_ZERO; - if (pos.count_in_hand(Us, pt) > 0) + if (pos.count_in_hand(Us, pt) > 0 && pt != KING) { Bitboard b = pos.drop_region(Us, pt) & ~pos.pieces() & (~attackedBy2[Them] | attackedBy[Us][ALL_PIECES]); if ((b & kingRing[Them]) && pt != SHOGI_PAWN) @@ -1478,7 +1478,7 @@ namespace { // Evaluate pieces in hand once attack tables are complete if (pos.piece_drops() || pos.seirawan_gating()) - for (PieceType pt = PAWN; pt < KING; ++pt) + for (PieceType pt : pos.piece_types()) score += hand(pt) - hand(pt); score += (mobility[WHITE] - mobility[BLACK]) * (1 + pos.captures_to_hand() + pos.must_capture() + pos.check_counting()); -- 1.7.0.4