Skip to content

Commit 7735149

Browse files
committed
Checking in change that has been sitting around for two years!
I made this small change on April 29, 2018, but never checked it in. It looks like I was delaying regenerating the list of legal moves a human player could make until right before I check to see if the given move is legal. It looks legit.
1 parent 34754b8 commit 7735149

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/human.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ bool HumanChessPlayer::GetMove (
5151
return false;
5252
}
5353

54-
// Regenerate legal moves in case they edited the board.
55-
board.GenMoves ( legalMoves );
56-
5754
// The following check allows certain UI tricks to work...
5855
if ( dest == SPECIAL_MOVE_NULL ||
5956
(dest & SPECIAL_MOVE_MASK) == SPECIAL_MOVE_EDIT )
@@ -68,6 +65,9 @@ bool HumanChessPlayer::GetMove (
6865
// This checks for pawn promotion and stuff like that.
6966
move.Fix ( board, source, dest, promIndex, userInterface );
7067

68+
// Regenerate legal moves in case they edited the board.
69+
board.GenMoves(legalMoves);
70+
7171
// See if the move we just read is legal!
7272
for ( i=0; i < legalMoves.num; i++ )
7373
{

0 commit comments

Comments
 (0)