put_piece(): refactor
This commit is contained in:
parent
81f5a5e5ce
commit
2e57330126
|
@ -606,17 +606,15 @@ bool Position::put_piece(Square s, bool updateCmdlist)
|
||||||
|
|
||||||
Bitboard fromTo;
|
Bitboard fromTo;
|
||||||
|
|
||||||
if (phase == PHASE_GAMEOVER)
|
if (phase == PHASE_GAMEOVER ||
|
||||||
|
action != ACTION_PLACE ||
|
||||||
|
!onBoard[s] || board[s]) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (phase == PHASE_READY)
|
if (phase == PHASE_READY) {
|
||||||
start();
|
start();
|
||||||
|
}
|
||||||
if (action != ACTION_PLACE)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!onBoard[s]|| board[s])
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Position::square_to_polar(s, file, rank);
|
Position::square_to_polar(s, file, rank);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue