Skip to content

Commit

Permalink
FRC fix - send correct castling moves to UCI GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
MetatransApps committed Jul 24, 2022
1 parent c75c212 commit 8863752
Showing 1 changed file with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,31 @@ public MoveWrapper(int move, boolean isFRC, CastlingConfig castling_cfg) {

if (isFRC) {

/*if (fromIndex == toIndex) {
if (toIndex == CastlingConfig.G1) {

//Do nothing
toIndex = castling_cfg.from_SquareID_rook_kingside_w;

} else if (toIndex == CastlingConfig.C1) {

toIndex = castling_cfg.from_SquareID_rook_queenside_w;

} else if (toIndex == CastlingConfig.G8) {

toIndex = castling_cfg.from_SquareID_rook_kingside_b;

} else if (toIndex == CastlingConfig.C8) {

toIndex = castling_cfg.from_SquareID_rook_queenside_b;

} else {
*/
if (toIndex == CastlingConfig.G1) {

toIndex = castling_cfg.from_SquareID_rook_kingside_w;

} else if (toIndex == CastlingConfig.C1) {

toIndex = castling_cfg.from_SquareID_rook_queenside_w;

} else if (toIndex == CastlingConfig.G8) {

toIndex = castling_cfg.from_SquareID_rook_kingside_b;

} else if (toIndex == CastlingConfig.C8) {

toIndex = castling_cfg.from_SquareID_rook_queenside_b;

} else {

throw new IllegalStateException("toIndex=" + toIndex);
}
//}

throw new IllegalStateException("toIndex=" + toIndex);
}

toFile = (char) (104 - toIndex % 8);
toRank = toIndex / 8 + 1;

this.move = MoveUtil.createCastlingMove(fromIndex, toIndex);
}

break;
Expand Down

0 comments on commit 8863752

Please sign in to comment.