1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 09:13:08 +00:00

Bugfix. No legal move is either mate or stalemate.

This commit is contained in:
joergoster 2020-06-25 15:43:33 +02:00 committed by nodchip
parent 1c8a931309
commit a5fb69008c

View file

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