mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
DroidFish: Don't let a buggy engine play a null move.
This commit is contained in:
parent
f1e62c5263
commit
500b16dc8f
|
@ -148,8 +148,11 @@ public class Game {
|
|||
if (m != null)
|
||||
if (!TextIO.isValid(currPos(), m))
|
||||
m = null;
|
||||
if (m == null)
|
||||
if (m == null) {
|
||||
m = TextIO.stringToMove(currPos(), str);
|
||||
if (!TextIO.isValid(currPos(), m))
|
||||
m = null;
|
||||
}
|
||||
if (m == null)
|
||||
return new Pair<Boolean,Move>(false, null);
|
||||
|
||||
|
|
|
@ -468,7 +468,9 @@ public class GameTest extends TestCase {
|
|||
assertEquals(TextIO.UCIstringToMove("b8c6"), hist.second.get(1));
|
||||
assertEquals(expectedPos, hist.first);
|
||||
|
||||
game.processString("--");
|
||||
int varNo = game.tree.addMove("--", "", 0, "", "");
|
||||
assertEquals(0, varNo);
|
||||
game.tree.goForward(varNo);
|
||||
hist = game.getUCIHistory();
|
||||
expectedPos = new Position(game.currPos());
|
||||
assertEquals(0, hist.second.size());
|
||||
|
|
Loading…
Reference in New Issue
Block a user