movegen: 计算对手延迟到吃子再进行

This commit is contained in:
Calcitem 2019-11-24 01:57:05 +08:00
parent 4380566fa8
commit 9ac06bf94d
1 changed files with 3 additions and 3 deletions

View File

@ -28,9 +28,7 @@ void MoveList::generate(AIAlgorithm &ai, Game &tempGame,
AIAlgorithm::Node *node, AIAlgorithm::Node *root, move_t bestMove)
{
square_t square = SQ_0;
// 对手
player_t opponent = Player::getOpponent(tempGame.position.sideToMove);
player_t opponent = PLAYER_NOBODY;
// 列出所有合法的下一招
switch (tempGame.position.action) {
@ -98,6 +96,8 @@ void MoveList::generate(AIAlgorithm &ai, Game &tempGame,
// 对于吃子动作
case ACTION_CAPTURE:
opponent = Player::getOpponent(tempGame.position.sideToMove);
if (tempGame.position.board.isAllInMills(opponent)) {
// 全成三的情况
for (int i = Board::MOVE_PRIORITY_TABLE_SIZE - 1; i >= 0; i--) {