From 11a79809767e60897e0b015651db30ce1d36b69a Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 4 Dec 2011 12:24:15 +0100 Subject: [PATCH] Fix disambiguation bug in move_to_san() A pinned piece cannot move and so does not play any role in SAN disambiguation. Reported by Steven Edwards. No functional change. Signed-off-by: Marco Costalba --- src/move.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/move.cpp b/src/move.cpp index 1a312cbc..d079ee7b 100644 --- a/src/move.cpp +++ b/src/move.cpp @@ -106,6 +106,10 @@ const string move_to_san(Position& pos, Move m) { { sq = pop_1st_bit(&attackers); + // Pinned pieces are not included in the possible sub-set + if (!pos.pl_move_is_legal(make_move(sq, to), pos.pinned_pieces())) + continue; + if (file_of(sq) == file_of(from)) ambiguousFile = true; -- 2.39.2