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)] =
|
||||
ChessPiece(pieceClass, pieceAtStartSquare.color);
|
||||
|
||||
turnColor = state.newTurnColor == ChessColor.white
|
||||
? ChessColor.black
|
||||
: ChessColor.white;
|
||||
|
||||
emit(ChessBoardState(
|
||||
state.bottomColor,
|
||||
turnColor,
|
||||
|
Loading…
Reference in New Issue
Block a user