From 4b8624f82bb5f851e05ce754c9397efccefe7614 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 6 Jul 2023 00:12:03 +0200 Subject: [PATCH] Fix bug that did not change the move color when a promotion was received. --- lib/chess_bloc/chess_bloc.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/chess_bloc/chess_bloc.dart b/lib/chess_bloc/chess_bloc.dart index d9c7533..4d7acae 100644 --- a/lib/chess_bloc/chess_bloc.dart +++ b/lib/chess_bloc/chess_bloc.dart @@ -129,6 +129,10 @@ class ChessBloc extends Bloc { 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,