DroidFish: Fixed "force computer move" function.

This commit is contained in:
Peter Osterlund
2012-01-03 18:37:44 +00:00
parent e362208438
commit 6436c4f027
2 changed files with 7 additions and 1 deletions

View File

@@ -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);

View File

@@ -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. */