mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
DroidFish: In "sticky" edit board mode, if the target square already contains the selected piece, clear the square instead of doing nothing.
This commit is contained in:
parent
72b93358af
commit
5e4c179ca7
|
@ -203,8 +203,12 @@ public class EditBoard extends Activity {
|
|||
} else {
|
||||
piece = -(m.from + 2);
|
||||
}
|
||||
if (m.to >= 0)
|
||||
if (m.to >= 0) {
|
||||
if ((m.from < 0) && (pos.getPiece(m.to) == piece))
|
||||
pos.setPiece(m.to, Piece.EMPTY);
|
||||
else
|
||||
pos.setPiece(m.to, piece);
|
||||
}
|
||||
if (m.from >= 0)
|
||||
pos.setPiece(m.from, Piece.EMPTY);
|
||||
cb.setPosition(pos);
|
||||
|
|
Loading…
Reference in New Issue
Block a user