From 9743664c1ff625712318ed0ba3d52b35f4befe08 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Tue, 8 Sep 2020 01:43:57 +0800 Subject: [PATCH] =?UTF-8?q?position:=20=E7=AE=80=E5=8C=96=E5=BD=93?= =?UTF-8?q?=E6=91=86=E6=A3=8B=E5=AE=8C=E6=88=90=E6=97=B6=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E6=A3=8B=E6=96=B9=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/position.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index ea4d6625..fd66ffa6 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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)) {