From cfe4ce4e9b7352b5cc16ff98febf5122c8df5ff7 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Wed, 16 Oct 2019 23:56:40 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=B1=80?= =?UTF-8?q?=E9=98=B6=E6=AE=B5AI=E5=8F=AF=E8=83=BD=E8=A2=AB=E5=A0=B5?= =?UTF-8?q?=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交 79effc7 实现摆子阶段最后一着如果成三则先吃子再进入走棋阶段. 但是忘了在判断到未成三时且摆满时判断胜负,而是直接进入走棋阶段. 故会造成开局阶段AI可能被堵死. 现在补上这个判断,修复之. --- src/game/position.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/position.cpp b/src/game/position.cpp index 826f364b..e2a83c37 100644 --- a/src/game/position.cpp +++ b/src/game/position.cpp @@ -367,6 +367,11 @@ bool Game::place(square_t square, int8_t updateCmdlist) if (n == 0) { // 如果双方都无未放置的棋子 if (position.nPiecesInHand[BLACK] == 0 && position.nPiecesInHand[WHITE] == 0) { + // 决胜负 + if (win()) { + goto out; + } + // 进入中局阶段 position.phase = PHASE_MOVING;