position: 简化当摆棋完成时更换行棋方的逻辑

This commit is contained in:
Calcitem 2020-09-08 01:43:57 +08:00
parent d26c78580f
commit 9743664c1f
1 changed files with 4 additions and 8 deletions

View File

@ -657,10 +657,8 @@ bool Position::put_piece(Square s, bool updateCmdlist)
action = ACTION_SELECT;
clean_banned();
if (rule.isDefenderMoveFirst) {
set_side_to_move(WHITE);
} else {
set_side_to_move(BLACK);
if (!rule.isDefenderMoveFirst) {
change_side_to_move();
}
if (check_gameover_condition(updateCmdlist)) {
@ -818,10 +816,8 @@ bool Position::remove_piece(Square s, bool updateCmdlist)
action = ACTION_SELECT;
clean_banned();
if (rule.isDefenderMoveFirst) {
set_side_to_move(WHITE);
} else {
set_side_to_move(BLACK);
if (!rule.isDefenderMoveFirst) {
change_side_to_move();
}
if (check_gameover_condition(updateCmdlist)) {