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,9 +50,6 @@ ExtMove *generate<LEGAL>(/* const */ Position &pos, ExtMove *moveList)
continue; continue;
} }
if (pos.get_phase() != PHASE_READY) {
*cur++ = (Move)i;
} else {
#ifdef FIRST_MOVE_STAR_PREFERRED #ifdef FIRST_MOVE_STAR_PREFERRED
if (Position::is_star_square(s)) { if (Position::is_star_square(s)) {
moves.push_back((Move)s); moves.push_back((Move)s);
@ -60,7 +57,7 @@ ExtMove *generate<LEGAL>(/* const */ Position &pos, ExtMove *moveList)
#else #else
*cur++ = (Move)i; *cur++ = (Move)i;
#endif #endif
}
} }
break; break;
} }

View File

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