From 9394db765fba22eae790fe4dc79dfcd0f6a43a6d Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 31 Dec 2010 14:32:25 +0100 Subject: [PATCH] Remove dubious castle detector It was introduced by patch 66d16592 of 22/3/2009 merging from Glarurung iPhone. Tord says: That change is only found in the Glaurung iPhone app, and not in the latest Glaurung UCI source code. I don't remember why this was added (and the iPhone app, unlike the UCI engine, was never version controlled), but it was almost certainly because it was somehow needed in the communication between the engine and the iPhone GUI, and that it was never meant to be included in the UCI engine. My guess is that it has something to do with castling moves being entered as e1-g1 in the GUI, but represented as e1-h1 in the chess engine. Removing it in Stockfish should be completely safe, and won't harm the iPhone version. Initially the iPhone GUI called functions in the chess engine for checking for legality of moves, writing the move list in SAN format, and various other tasks, but this is no longer the case in the current version. No functional change. Signed-off-by: Marco Costalba --- src/san.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/san.cpp b/src/san.cpp index 963ea7c9..d8e7da15 100644 --- a/src/san.cpp +++ b/src/san.cpp @@ -73,9 +73,9 @@ const string move_to_san(Position& pos, Move m) { if (m == MOVE_NULL) return "(null)"; - if (move_is_long_castle(m) || (int(to - from) == -2 && pt == KING)) + if (move_is_long_castle(m)) san = "O-O-O"; - else if (move_is_short_castle(m) || (int(to - from) == 2 && pt == KING)) + else if (move_is_short_castle(m)) san = "O-O"; else { -- 2.39.2