mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-20 12:42:18 +01:00
DroidFish: Fixed "force computer move" function.
This commit is contained in:
@@ -409,6 +409,12 @@ public class DroidComputerPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
/** Tell engine to move now. */
|
||||
public void moveNow() {
|
||||
if (engineState.state == MainState.SEARCH)
|
||||
uciEngine.writeLineToEngine("stop");
|
||||
}
|
||||
|
||||
/** Return true if current search job is equal to id. */
|
||||
public final synchronized boolean sameSearchId(int id) {
|
||||
return (searchRequest != null) && (searchRequest.searchId == id);
|
||||
|
||||
@@ -488,7 +488,7 @@ public class DroidChessController {
|
||||
/** Request computer player to make a move immediately. */
|
||||
public final synchronized void stopSearch() {
|
||||
if (!humansTurn() && (computerPlayer != null))
|
||||
computerPlayer.stopSearch();
|
||||
computerPlayer.moveNow();
|
||||
}
|
||||
|
||||
/** Stop ponder search. */
|
||||
|
||||
Reference in New Issue
Block a user