Support red as color in Xiangqi FENs
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 11 Mar 2021 19:52:50 +0000 (20:52 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 11 Mar 2021 19:52:50 +0000 (20:52 +0100)
src/position.cpp

index 20e6ffb..d9deef6 100644 (file)
@@ -307,7 +307,7 @@ Position& Position::set(const Variant* v, const string& fenStr, bool isChess960,
 
   // 2. Active color
   ss >> token;
-  sideToMove = (token == 'w' ? WHITE : BLACK);
+  sideToMove = (token == 'w' || token == 'r' ? WHITE : BLACK);
   // Invert side to move for SFEN
   if (sfen)
       sideToMove = ~sideToMove;