mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
Bugfix. No legal move is either mate or stalemate.
This commit is contained in:
+13
-5
@@ -504,16 +504,24 @@ void MultiThinkGenSfen::thread_worker(size_t thread_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pos.is_draw(ply)) {
|
if (pos.is_draw(ply)) {
|
||||||
// Do not write if draw.
|
#if defined (LEARN_GENSFEN_USE_DRAW_RESULT)
|
||||||
break;
|
flush_psv(0);
|
||||||
|
#endif
|
||||||
|
// Do not write if draw.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全駒されて詰んでいたりしないか?
|
// 全駒されて詰んでいたりしないか?
|
||||||
if (MoveList<LEGAL>(pos).size() == 0)
|
if (MoveList<LEGAL>(pos).size() == 0) // Can be mate or stalemate
|
||||||
{
|
{
|
||||||
// (この局面の一つ前の局面までは書き出す)
|
// (この局面の一つ前の局面までは書き出す)
|
||||||
// Write the positions other than this position if checkmated.
|
// Write the positions other than this position if checkmated.
|
||||||
flush_psv(-1);
|
if (pos.checkers()) // Mate
|
||||||
|
flush_psv(-1);
|
||||||
|
#if defined (LEARN_GENSFEN_USE_DRAW_RESULT)
|
||||||
|
else // Stalemate
|
||||||
|
flush_psv(0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -578,7 +586,7 @@ void MultiThinkGenSfen::thread_worker(size_t thread_id)
|
|||||||
if (pos.is_draw(0)) {
|
if (pos.is_draw(0)) {
|
||||||
#if defined (LEARN_GENSFEN_USE_DRAW_RESULT)
|
#if defined (LEARN_GENSFEN_USE_DRAW_RESULT)
|
||||||
// 引き分けを書き出すとき
|
// 引き分けを書き出すとき
|
||||||
flush_psv(is_win);
|
flush_psv(0);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user