From 07d5eb92bb58c23151b85a417933d6bcfacc491f Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sat, 21 Mar 2020 18:13:29 +0100 Subject: [PATCH] Safer pseudo-legal move validation for drops crazyhouse STC LLR: 2.96 (-2.94,2.94) [-10.00,5.00] Total: 6452 W: 3127 L: 3107 D: 218 http://www.variantfishtest.org:6543/tests/view/5e6a9cae6e23db46beba4f9a crazyhouse LTC LLR: 2.99 (-2.94,2.94) [-10.00,5.00] Total: 5895 W: 2831 L: 2807 D: 257 http://www.variantfishtest.org:6543/tests/view/5e6b45b36e23db46beba4f9d --- src/position.cpp | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 0596378..08d1336 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -938,6 +938,8 @@ bool Position::pseudo_legal(const Move m) const { // Use a fast check for piece drops if (type_of(m) == DROP) return piece_drops() + && pc != NO_PIECE + && color_of(pc) == us && count_in_hand(us, in_hand_piece_type(m)) && (drop_region(us, type_of(pc)) & ~pieces() & to) && ( type_of(pc) == in_hand_piece_type(m) -- 1.7.0.4