Fix: 修复开局阶段AI可能被堵死的问题

提交 79effc7 实现摆子阶段最后一着如果成三则先吃子再进入走棋阶段.
但是忘了在判断到未成三时且摆满时判断胜负,而是直接进入走棋阶段.
故会造成开局阶段AI可能被堵死. 现在补上这个判断,修复之.
This commit is contained in:
Calcitem 2019-10-16 23:56:40 +08:00
parent 618b294280
commit cfe4ce4e9b
1 changed files with 5 additions and 0 deletions

View File

@ -367,6 +367,11 @@ bool Game::place(square_t square, int8_t updateCmdlist)
if (n == 0) { if (n == 0) {
// 如果双方都无未放置的棋子 // 如果双方都无未放置的棋子
if (position.nPiecesInHand[BLACK] == 0 && position.nPiecesInHand[WHITE] == 0) { if (position.nPiecesInHand[BLACK] == 0 && position.nPiecesInHand[WHITE] == 0) {
// 决胜负
if (win()) {
goto out;
}
// 进入中局阶段 // 进入中局阶段
position.phase = PHASE_MOVING; position.phase = PHASE_MOVING;