flutter: game: doMove: Do not add to moveHistory if position.doMove return false
This commit is contained in:
parent
f0f28d9d4f
commit
0b6d58da36
|
@ -120,12 +120,12 @@ class Game {
|
|||
|
||||
print("Computer: $move");
|
||||
|
||||
moveHistory.add(move);
|
||||
|
||||
if (!position.doMove(move)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
moveHistory.add(move);
|
||||
|
||||
sideToMove = position.sideToMove() ?? PieceColor.nobody;
|
||||
|
||||
printStat();
|
||||
|
|
Loading…
Reference in New Issue