File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/pl/nogacz/chess/board Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,6 @@ public void readMouseEvent(MouseEvent event) {
125125 endGame ("You loss. Maybe you try again?" );
126126 }
127127 } else if (eventCoordinates .isValid ()) {
128-
129128 if (isSelected ) {
130129 if (eventCoordinates .equals (selectedCoordinates )) {
131130 selectedCoordinates = null ;
@@ -149,6 +148,15 @@ public void readMouseEvent(MouseEvent event) {
149148 checkPromote (eventCoordinates , 0 );
150149
151150 computerMove ();
151+ } else if (isFieldNotNull (eventCoordinates ) && Board .getPawn (eventCoordinates ).getColor ().isWhite () && isPossibleSelect (eventCoordinates , PawnColor .WHITE )) {
152+ possibleMovePromote .clear ();
153+ possibleKickPromote .clear ();
154+
155+ unLightSelect (selectedCoordinates );
156+
157+ selectedCoordinates = eventCoordinates ;
158+ isSelected = true ;
159+ lightSelect (eventCoordinates );
152160 }
153161 } else {
154162 if (isFieldNotNull (eventCoordinates )) {
You can’t perform that action at this time.
0 commit comments