Fix: Rooks going up didn't consider the topleft square
parent
49d8d675d4
commit
943aab1a14
|
|
@ -203,7 +203,7 @@ class _LegalMovesBlack {
|
||||||
// up
|
// up
|
||||||
bool hasEncounteredPiece = false;
|
bool hasEncounteredPiece = false;
|
||||||
int j = i-8;
|
int j = i-8;
|
||||||
while (!hasEncounteredPiece && j > 0) {
|
while (!hasEncounteredPiece && j >= 0) {
|
||||||
if (Piece.emptySquare == position.board[j]) {
|
if (Piece.emptySquare == position.board[j]) {
|
||||||
yield ("${Position.squareIndexToString(i)}${Position.squareIndexToString(j)}", Position.from(position)..playMoveIndices(i, j));
|
yield ("${Position.squareIndexToString(i)}${Position.squareIndexToString(j)}", Position.from(position)..playMoveIndices(i, j));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ class _LegalMovesWhite {
|
||||||
// up
|
// up
|
||||||
bool hasEncounteredPiece = false;
|
bool hasEncounteredPiece = false;
|
||||||
int j = i-8;
|
int j = i-8;
|
||||||
while (!hasEncounteredPiece && j > 0) {
|
while (!hasEncounteredPiece && j >= 0) {
|
||||||
if (Piece.emptySquare == position.board[j]) {
|
if (Piece.emptySquare == position.board[j]) {
|
||||||
yield ("${Position.squareIndexToString(i)}${Position.squareIndexToString(j)}", Position.from(position)..playMoveIndices(i, j));
|
yield ("${Position.squareIndexToString(i)}${Position.squareIndexToString(j)}", Position.from(position)..playMoveIndices(i, j));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue