From 9ac06bf94db380847f08168f5d5c37969f1354f9 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 24 Nov 2019 01:57:05 +0800 Subject: [PATCH] =?UTF-8?q?movegen:=20=E8=AE=A1=E7=AE=97=E5=AF=B9=E6=89=8B?= =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=88=B0=E5=90=83=E5=AD=90=E5=86=8D=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ai/movegen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ai/movegen.cpp b/src/ai/movegen.cpp index 63f6b98d..5125b5ef 100644 --- a/src/ai/movegen.cpp +++ b/src/ai/movegen.cpp @@ -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--) {