Fix duplicate branches for 'if' and 'else'

This commit is contained in:
Calcitem 2020-11-01 10:31:32 +08:00
parent 9e422b8a6b
commit 4728aa625a
2 changed files with 8 additions and 13 deletions

View File

@ -50,17 +50,14 @@ ExtMove *generate<LEGAL>(/* const */ Position &pos, ExtMove *moveList)
continue;
}
if (pos.get_phase() != PHASE_READY) {
*cur++ = (Move)i;
} else {
#ifdef FIRST_MOVE_STAR_PREFERRED
if (Position::is_star_square(s)) {
moves.push_back((Move)s);
}
#else
*cur++ = (Move)i;
#endif
if (Position::is_star_square(s)) {
moves.push_back((Move)s);
}
#else
*cur++ = (Move)i;
#endif
}
break;
}

View File

@ -374,10 +374,8 @@ void GameController::setEngine(Color color, bool enabled)
if (enabled == true) {
aiThread[color]->setAi(&position);
if (aiThread[color]->searching)
aiThread[color]->start_searching();
else
aiThread[color]->start_searching();
aiThread[color]->start_searching();
} else {
aiThread[color]->pause();
}