Fix bug that did not change the move color when a promotion was received.
This commit is contained in:
parent
95fba78d0c
commit
4b8624f82b
@ -129,6 +129,10 @@ class ChessBloc extends Bloc<ChessEvent, ChessBoardState> {
|
|||||||
newPosition[ChessCoordinate(event.endSquare.column, event.endSquare.row)] =
|
newPosition[ChessCoordinate(event.endSquare.column, event.endSquare.row)] =
|
||||||
ChessPiece(pieceClass, pieceAtStartSquare.color);
|
ChessPiece(pieceClass, pieceAtStartSquare.color);
|
||||||
|
|
||||||
|
turnColor = state.newTurnColor == ChessColor.white
|
||||||
|
? ChessColor.black
|
||||||
|
: ChessColor.white;
|
||||||
|
|
||||||
emit(ChessBoardState(
|
emit(ChessBoardState(
|
||||||
state.bottomColor,
|
state.bottomColor,
|
||||||
turnColor,
|
turnColor,
|
||||||
|
Loading…
Reference in New Issue
Block a user