for( i=0; i<(int) EmptySquare; i++ ) table[i] = '.';
for( i=offs=0; i<NrPieces/2-1; i++ ) {
char *p;
- if(map[j] == '/' && *escapes) offs = CHUPROMOTED WhitePawn - i, j++;
+ if(map[j] == '/' && *escapes) offs = WhiteTokin - i, j++;
table[i + offs] = map[j++];
if(p = strchr(escapes, map[j])) j++, table[i + offs] += 64*(p - escapes + 1);
}
table[(int) WhiteKing] = map[j++];
for( i=offs=0; i<NrPieces/2-1; i++ ) {
char *p;
- if(map[j] == '/' && *escapes) offs = CHUPROMOTED WhitePawn - i, j++;
+ if(map[j] == '/' && *escapes) offs = WhiteTokin - i, j++;
table[WHITE_TO_BLACK i + offs] = map[j++];
if(p = strchr(escapes, map[j])) j++, table[WHITE_TO_BLACK i + offs] += 64*(p - escapes + 1);
}
int i, j, k, w=0, subst=0, shuffle=0, wKingRank = -1, bKingRank = -1;
char *p, c;
int emptycount, virgin[BOARD_FILES];
- ChessSquare piece;
+ ChessSquare piece, king = (gameInfo.variant == VariantKnightmate ? WhiteUnicorn : WhiteKing);
p = fen;
p++;
}
board[i][(j++)+gameInfo.holdingsWidth] = piece;
- if(piece == WhiteKing) wKingRank = i;
- if(piece == BlackKing) bKingRank = i;
+ if(piece == king) wKingRank = i;
+ if(piece == WHITE_TO_BLACK king) bKingRank = i;
} else {
return FALSE;
}