Skip to content

Commit

Permalink
Updated move()
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Sep 27, 2024
1 parent eb8575c commit 7c38766
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Variant/AbstractBoard.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ protected function move(AbstractPiece $piece): bool
if ($piece->move['isCapture']) {
$this->capture($piece);
}
if ($toDetach = $this->pieceBySq($piece->sq)) {
$this->detach($toDetach);
}
$this->detach($this->pieceBySq($piece->sq));
$class = VariantType::getClass($this->pieceVariant, $piece->id);
$this->attach(new $class(
$piece->color,
Expand Down

0 comments on commit 7c38766

Please sign in to comment.