修复提交 2eb0872 引入的自动认输异常问题

并解决历史信息中点击历史不会正常显示局面的问题.
This commit is contained in:
CalciteM Team 2019-09-15 08:27:04 +08:00
parent 386b008362
commit 499468bd04
3 changed files with 4 additions and 3 deletions

View File

@ -679,7 +679,7 @@ const char* MillGameAi_ab::bestMove()
// 自动认输
if (isMostLose) {
sprintf(cmdline, "Player%d give up!", position_.context.turnChar);
sprintf(cmdline, "Player%d give up!", position_.context.turnId);
return cmdline;
}
}

View File

@ -50,7 +50,7 @@ public:
inline static player_t idToPlayer(int id)
{
return player_t(id << PLAYER_SHIFT);
return id == 1? PLAYER_1 : PLAYER_2;
}
inline static char idToCh(int id)

View File

@ -704,7 +704,8 @@ bool Position::giveup(player_t loser)
// 打算用个C++的命令行解析库的,简单的没必要,但中文编码有极小概率出问题
bool Position::command(const char *cmd)
{
int r, t;
int r;
unsigned t;
step_t s;
int r1, s1, r2, s2;
int args = 0;