Fix ResignIfMostLose cannot work

This commit is contained in:
Calcitem 2021-02-10 22:37:29 +08:00
parent 8cb285f215
commit d3d6b09ff3
2 changed files with 8 additions and 9 deletions

View File

@ -891,7 +891,7 @@ bool Position::resign(Color loser)
set_gameover(~loser, GameOverReason::loseReasonResign);
//snprintf(record, RECORD_LEN_MAX, loseReasonResignStr, loser);
snprintf(record, RECORD_LEN_MAX, loseReasonResignStr, loser);
return true;
}

View File

@ -26,6 +26,7 @@
#include "uci.h"
#include "tt.h"
#include "option.h"
#include "mills.h"
#ifdef PERFECT_AI_SUPPORT
#include "perfect/perfect.h"
@ -578,18 +579,16 @@ string Thread::nextMove()
}
#endif /* ENDGAME_LEARNING */
#endif
if (gameOptions.getResignIfMostLose() == true) {
if (root->value <= -VALUE_MATE) {
gameOverReason = loseReasonResign;
//snprintf(record, Position::RECORD_LEN_MAX, loseReasonResignStr, position->sideToMove);
return record;
if (bestvalue <= -VALUE_MATE) {
rootPos->set_gameover(~rootPos->sideToMove, GameOverReason::loseReasonResign);
snprintf(rootPos->record, Position::RECORD_LEN_MAX, loseReasonResignStr, rootPos->sideToMove);
return rootPos->record;
}
}
nodeCount = 0;
#endif
#ifdef TRANSPOSITION_TABLE_ENABLE
#ifdef TRANSPOSITION_TABLE_DEBUG
size_t hashProbeCount = ttHitCount + ttMissCount;