endgame: 搜索到必胜值再加上层数且修复缺少 break 的问题

This commit is contained in:
CalciteM Team 2019-09-18 00:39:28 +08:00
parent cf2fdb360b
commit 671882c760
1 changed files with 4 additions and 0 deletions

View File

@ -418,8 +418,12 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
switch (endgame.type) {
case ENDGAME_PLAYER_1_WIN:
node->value = VALUE_WIN;
node->value += depth;
break;
case ENDGAME_PLAYER_2_WIN:
node->value = -VALUE_WIN;
node->value -= depth;
break;
default:
break;
}