]> git.sesse.net Git - stockfish/commitdiff
Remove dubious castle detector
authorMarco Costalba <mcostalba@gmail.com>
Fri, 31 Dec 2010 13:32:25 +0000 (14:32 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 31 Dec 2010 13:32:25 +0000 (14:32 +0100)
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 <mcostalba@gmail.com>
src/san.cpp

index 963ea7c9f8bddc52f1b099215c8113cf7bdd4eaa..d8e7da15a7f8b7b83931956f7a8d9beb6d432f13 100644 (file)
@@ -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
   {