diff --git a/lib/Default/ChessPiece.class.php b/lib/Default/ChessPiece.class.php index f5539b192..9074d7ded 100644 --- a/lib/Default/ChessPiece.class.php +++ b/lib/Default/ChessPiece.class.php @@ -52,9 +52,9 @@ public function isSafeMove(array &$board, &$hasMoved, $toX = -1, $toY = -1) { } public function isAttacking(array &$board, array &$hasMoved, $king, $x = -1, $y = -1) { - $moves =& $this->getPossibleMoves($board, $hasMoved, null, true); - foreach($moves as &$move) { - $p =& $board[$move[1]][$move[0]]; + $moves = $this->getPossibleMoves($board, $hasMoved, null, true); + foreach($moves as $move) { + $p = $board[$move[1]][$move[0]]; if(($move[0] == $x && $move[1] == $y) || ($king === true && $p != null && $p->pieceID == self::KING && $this->colour != $p->colour)) { return true; } @@ -62,7 +62,7 @@ public function isAttacking(array &$board, array &$hasMoved, $king, $x = -1, $y return false; } - public function &getPossibleMoves(array &$board, array &$hasMoved, $forAccountID = null, $attackingCheck = false) { + public function getPossibleMoves(array &$board, array &$hasMoved, $forAccountID = null, $attackingCheck = false) { $moves = array(); if ($forAccountID == null || $this->accountID == $forAccountID) { if ($this->pieceID == self::PAWN) {