Fix bug that would not allow a piece move if you tried to take an opponents piece.
This commit is contained in:
parent
5bb658ca0f
commit
ff34e052dc
@ -27,12 +27,12 @@ class TapBloc extends Bloc<TapEvent, TapState> {
|
||||
ChessPiece? piece;
|
||||
|
||||
if (ChessBloc.myColor != ChessBloc.turnColor) return;
|
||||
if (event.pieceOnSquare != null &&
|
||||
ChessBloc.myColor != event.pieceOnSquare!.color) return;
|
||||
|
||||
if (state.firstSquareTapped == null) {
|
||||
//first tap
|
||||
if (event.pieceOnSquare == null) return;
|
||||
if (event.pieceOnSquare != null &&
|
||||
ChessBloc.myColor != event.pieceOnSquare!.color) return;
|
||||
firstTappedSquare = event.tapped;
|
||||
piece = event.pieceOnSquare;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user