Fix CECP notation for Fischer castling hgm
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 20 Dec 2025 12:40:08 +0000 (13:40 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 20 Dec 2025 12:40:08 +0000 (13:40 +0100)
FSF was using UCI's KxR notation even in CECP, where it has to be O-O(-O).

src/uci.cpp

index 584977a..fa916ae 100644 (file)
@@ -534,6 +534,8 @@ string UCI::move(const Position& pos, Move m) {
   string move = (type_of(m) == DROP ? UCI::dropped_piece(pos, m) + (CurrentProtocol == USI ? '*' : '@')
                                     : UCI::square(pos, from)) + UCI::square(pos, to);
 
+  if(CurrentProtocol == XBOARD && type_of(m) == CASTLING && pos.is_chess960()) move = to > from ? "O-O" : "O-O-O";
+
   // Wall square
   if (pos.walling() && CurrentProtocol == XBOARD)
       move += "," + UCI::square(pos, to) + UCI::square(pos, gating_square(m));