X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=moves.c;h=72671731c5a64cedc5da8603bca7062b16f2ebcb;hb=0ccbe7c602352f55e143e4e533c3c2b7b773dda6;hp=f281aa7f2ec6bafb26278f43a8ce44983ed28004;hpb=fd3bdfd7587b74332180fc829650ce4681890979;p=xboard.git diff --git a/moves.c b/moves.c index f281aa7..7267173 100644 --- a/moves.c +++ b/moves.c @@ -144,6 +144,7 @@ char pieceToChar[] = { 'p', 'n', 'b', 'r', 'q', 'f', 'e', 'a', 'c', 'w', 'm', 'o', 'h', 'i', 'j', 'g', 'd', 'v', 'l', 's', 'u', 'k', 'x' }; +char pieceNickName[EmptySquare]; char PieceToChar(p) ChessSquare p; @@ -167,6 +168,8 @@ ChessSquare CharToPiece(c) { int i; for(i=0; i< (int) EmptySquare; i++) + if(pieceNickName[i] == c) return (ChessSquare) i; + for(i=0; i< (int) EmptySquare; i++) if(pieceToChar[i] == c) return (ChessSquare) i; return EmptySquare; }