diff --git a/engine/Default/chess.php b/engine/Default/chess.php
index 99bf942e5..5e3d630c7 100644
--- a/engine/Default/chess.php
+++ b/engine/Default/chess.php
@@ -1,6 +1,6 @@
getAccountID());
+$chessGames = ChessGame::getOngoingAccountGames($player->getAccountID());
$template->assign('ChessGames', $chessGames);
$playersChallenged = array($player->getAccountID() => true);
diff --git a/engine/Default/chess_move_processing.php b/engine/Default/chess_move_processing.php
index 3b9ae7b58..7cf5385df 100644
--- a/engine/Default/chess_move_processing.php
+++ b/engine/Default/chess_move_processing.php
@@ -1,6 +1,6 @@
assign('ChessGame',$chessGame);
if(is_numeric($_REQUEST['x']) && is_numeric($_REQUEST['y']) && is_numeric($_REQUEST['toX']) && is_numeric($_REQUEST['toY'])) {
$x = $_REQUEST['x'];
diff --git a/engine/Default/chess_resign_processing.php b/engine/Default/chess_resign_processing.php
index 66c5b99fa..855ecf2f5 100644
--- a/engine/Default/chess_resign_processing.php
+++ b/engine/Default/chess_resign_processing.php
@@ -1,6 +1,6 @@
resign($player->getAccountID());
$container = create_container('skeleton.php', 'current_sector.php');
diff --git a/engine/Default/combat_simulator.php b/engine/Default/combat_simulator.php
index 3a3599460..fdfc5f6ab 100644
--- a/engine/Default/combat_simulator.php
+++ b/engine/Default/combat_simulator.php
@@ -77,15 +77,15 @@ function runAnAttack($realAttackers,$realDefenders) {
global $template;
$results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0),
'Defenders' => array('Traders' => array(), 'TotalDamage' => 0));
- foreach($realAttackers as $accountID => &$teamPlayer) {
+ foreach ($realAttackers as $accountID => $teamPlayer) {
$playerResults =& $teamPlayer->shootPlayers($realDefenders);
$results['Attackers']['Traders'][] =& $playerResults;
$results['Attackers']['TotalDamage'] += $playerResults['TotalDamage'];
- } unset($teamPlayer);
- foreach($realDefenders as $accountID => &$teamPlayer) {
+ }
+ foreach ($realDefenders as $accountID => $teamPlayer) {
$playerResults =& $teamPlayer->shootPlayers($realAttackers);
$results['Defenders']['Traders'][] =& $playerResults;
$results['Defenders']['TotalDamage'] += $playerResults['TotalDamage'];
- } unset($teamPlayer);
+ }
$template->assign('TraderCombatResults',$results);
}
diff --git a/engine/Default/edit_dummys.php b/engine/Default/edit_dummys.php
index beaff14b9..b48cf4026 100644
--- a/engine/Default/edit_dummys.php
+++ b/engine/Default/edit_dummys.php
@@ -8,8 +8,8 @@
$template->assign('EditDummysLink',SmrSession::getNewHREF(create_container('skeleton.php','edit_dummys.php')));
-$dummyPlayer =& DummyPlayer::getCachedDummyPlayer($_REQUEST['dummy_name']);
-$dummyShip =& $dummyPlayer->getShip();
+$dummyPlayer = DummyPlayer::getCachedDummyPlayer($_REQUEST['dummy_name']);
+$dummyShip = $dummyPlayer->getShip();
if(isset($_REQUEST['save_dummy'])) {
$dummyPlayer->setPlayerName($_REQUEST['dummy_name']);
diff --git a/engine/Default/galactic_post_view_applications.php b/engine/Default/galactic_post_view_applications.php
index 8677d2ab6..54b731e7f 100644
--- a/engine/Default/galactic_post_view_applications.php
+++ b/engine/Default/galactic_post_view_applications.php
@@ -11,7 +11,7 @@
else
$PHP_OUTPUT.=('You have no applications to view at the current time.');
while ($db->nextRecord()) {
- $appliee =& SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID());
+ $appliee = SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID());
$container = array();
$container['url'] = 'skeleton.php';
@@ -30,7 +30,7 @@
$db->query('SELECT * FROM galactic_post_applications WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id = '.$db->escapeNumber($var['id']));
$db->nextRecord();
$desc = stripslashes($db->getField('description'));
- $applie =& SmrPlayer::getPlayer($var['id'], $player->getGameID());
+ $applie = SmrPlayer::getPlayer($var['id'], $player->getGameID());
$PHP_OUTPUT.=('Name : '.$applie->getPlayerName().'
');
$PHP_OUTPUT.=('Have you written for some kind of newspaper before? ' . $db->getField('written_before'));
$PHP_OUTPUT.=('
');
diff --git a/engine/Default/galactic_post_view_members.php b/engine/Default/galactic_post_view_members.php
index 12d4de63b..41d0bd9af 100644
--- a/engine/Default/galactic_post_view_members.php
+++ b/engine/Default/galactic_post_view_members.php
@@ -21,7 +21,7 @@
while ($db->nextRecord()) {
- $curr_writter =& SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID());
+ $curr_writter = SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID());
$time = $db->getField('last_wrote');
$PHP_OUTPUT.=('
');
$PHP_OUTPUT.=(''.$curr_writter->getPlayerName().' | ');
diff --git a/engine/Default/sector_jump_processing.php b/engine/Default/sector_jump_processing.php
index 1527f7953..497ac5181 100644
--- a/engine/Default/sector_jump_processing.php
+++ b/engine/Default/sector_jump_processing.php
@@ -94,7 +94,7 @@
acquire_lock($player->getSectorID());
// get new sector object
-$sector =& $player->getSector();
+$sector = $player->getSector();
// make current sector visible to him
$sector->markVisited($player);
diff --git a/engine/Default/sector_move_processing.php b/engine/Default/sector_move_processing.php
index 161ec1e35..af2614d33 100644
--- a/engine/Default/sector_move_processing.php
+++ b/engine/Default/sector_move_processing.php
@@ -16,7 +16,7 @@
$player->update();
// get new sector object
- $sector =& $player->getSector();
+ $sector = $player->getSector();
$sector->markVisited($player);
forward(create_container('skeleton.php', $var['target_page']));
}
@@ -89,7 +89,7 @@
acquire_lock($var['target_sector']);
// get new sector object
-$sector =& $player->getSector();
+$sector = $player->getSector();
//add that the player explored here if it hasnt been explored...for HoF
if (!$sector->isVisited($player)) {
diff --git a/engine/Default/shop_ship_processing.php b/engine/Default/shop_ship_processing.php
index a5bfc7cb8..636b5410f 100644
--- a/engine/Default/shop_ship_processing.php
+++ b/engine/Default/shop_ship_processing.php
@@ -1,7 +1,7 @@
getGameID()),$shipID);
+$newShip = AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()),$shipID);
$cost = $ship->getCostToUpgrade($shipID);
// trade master 33
diff --git a/lib/Default/ChessGame.class.inc b/lib/Default/ChessGame.class.inc
index 8a625fd1f..b677ff150 100644
--- a/lib/Default/ChessGame.class.inc
+++ b/lib/Default/ChessGame.class.inc
@@ -33,9 +33,9 @@ class ChessGame {
WHERE end_time > ' . TIME . ' OR end_time IS NULL;');
$games = array();
while($db->nextRecord()) {
- $game =& self::getChessGame($db->getInt('chess_game_id'), $forceUpdate);
+ $game = self::getChessGame($db->getInt('chess_game_id'), $forceUpdate);
if($game->getCurrentTurnAccount()->isNPC()) {
- $games[] =& $game;
+ $games[] = $game;
}
}
return $games;
@@ -46,7 +46,7 @@ class ChessGame {
$db->query('SELECT chess_game_id FROM chess_game WHERE (black_id = ' . $db->escapeNumber($accountID) . ' OR white_id = ' . $db->escapeNumber($accountID) . ') AND (end_time > ' . TIME . ' OR end_time IS NULL);');
$games = array();
while($db->nextRecord()) {
- $games[] =& self::getChessGame($db->getInt('chess_game_id'));
+ $games[] = self::getChessGame($db->getInt('chess_game_id'));
}
return $games;
}
@@ -56,7 +56,7 @@ class ChessGame {
$db->query('SELECT chess_game_id FROM chess_game WHERE black_id = ' . $db->escapeNumber($accountID) . ' OR white_id = ' . $db->escapeNumber($accountID) . ';');
$games = array();
while($db->nextRecord()) {
- $games[] =& self::getChessGame($db->getInt('chess_game_id'));
+ $games[] = self::getChessGame($db->getInt('chess_game_id'));
}
return $games;
}
@@ -642,7 +642,7 @@ class ChessGame {
if($this->getCurrentTurnAccountID() != $forAccountID) {
return 4;
}
- $lastTurnPlayer =& $this->getCurrentTurnPlayer();
+ $lastTurnPlayer = $this->getCurrentTurnPlayer();
$this->getBoard();
$p = $this->board[$y][$x];
if($p == null || $p->colour != $this->getColourForAccountID($forAccountID)) {
@@ -653,7 +653,7 @@ class ChessGame {
foreach($moves as $move) {
if($move[0]==$toX && $move[1]==$toY) {
$chessType = $this->isNPCGame() ? 'Chess (NPC)' : 'Chess';
- $currentPlayer =& $this->getCurrentTurnPlayer();
+ $currentPlayer = $this->getCurrentTurnPlayer();
$moveInfo = ChessGame::movePiece($this->board, $this->getHasMoved(), $x, $y, $toX, $toY, $pawnPromotionPiece);
@@ -689,7 +689,7 @@ class ChessGame {
return 3;
}
- $otherPlayer =& $this->getCurrentTurnPlayer();
+ $otherPlayer = $this->getCurrentTurnPlayer();
if($moveInfo['PawnPromotion'] !== false) {
$piecePromotedSymbol = $p->getPieceSymbol();
$currentPlayer->increaseHOF(1, array($chessType,'Moves','Own Pawns Promoted','Total'), HOF_PUBLIC);
diff --git a/lib/Default/DummyPlayer.class.inc b/lib/Default/DummyPlayer.class.inc
index 73a1ab12b..3ba742b4a 100644
--- a/lib/Default/DummyPlayer.class.inc
+++ b/lib/Default/DummyPlayer.class.inc
@@ -47,7 +47,7 @@ class DummyPlayer extends AbstractSmrPlayer {
}
public function killPlayer($sectorID) {
-// $sector =& SmrSector::getSector($this->getGameID(),$sectorID);
+// $sector = SmrSector::getSector($this->getGameID(),$sectorID);
//msg taken care of in trader_att_proc.php
// forget plotted course
// $this->deletePlottedCourse();
diff --git a/lib/Default/RouteGenerator.class.inc b/lib/Default/RouteGenerator.class.inc
index 3032c7372..594f1797f 100644
--- a/lib/Default/RouteGenerator.class.inc
+++ b/lib/Default/RouteGenerator.class.inc
@@ -101,15 +101,14 @@ class RouteGenerator {
if ($goods[GOOD_NOTHING]===true)
$rl[] = new OneWayRoute($currentSectorId, $targetSectorId, $races[$raceID], $sectors[$targetSectorId]->getPort()->getRaceID(), 0, 0, $distance, GOOD_NOTHING);
- $gameGoods = Globals::getGoods();
- foreach($gameGoods as $goodId => &$value) {
+ foreach (Globals::getGoods() as $goodId => $value) {
if ($goods[$goodId]===true) {
if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_SELLS &&
$sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) {
$rl[] = new OneWayRoute($currentSectorId, $targetSectorId, $races[$raceID], $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId);
}
}
- } unset($value);
+ }
} unset($distance);
$routes[$sectors[$currentSectorId]->getSectorID()] = $rl;
} unset($d);
@@ -128,8 +127,7 @@ class RouteGenerator {
if($routesForPort!==-1 && $currentSectorId !== $routesForPort && $targetSectorId !== $routesForPort)
continue;
- $gameGoods =& Globals::getGoods();
- foreach($gameGoods as $goodId => &$value) {
+ foreach (Globals::getGoods() as $goodId => $value) {
if ($goods[$goodId]===true) {
if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_SELLS &&
$sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) {
@@ -140,7 +138,7 @@ class RouteGenerator {
self::addMoneyRoute($mpr);
}
}
- } unset($value);
+ }
} unset($distance);
} unset($d);
$allRoutes = array();
diff --git a/lib/Default/smr.inc b/lib/Default/smr.inc
index 2da2e4042..07589e1d9 100644
--- a/lib/Default/smr.inc
+++ b/lib/Default/smr.inc
@@ -87,7 +87,7 @@ function smrBBCode($bbParser, $action, $tagName, $default, $tagParams, $tagConte
break;
case 'chess':
$chessGameID = $default;
- $chessGame =& ChessGame::getChessGame($chessGameID);
+ $chessGame = ChessGame::getChessGame($chessGameID);
if ($action == \Nbbc\BBCode::BBCODE_CHECK) {
return true;
}
diff --git a/templates/Default/admin/Default/1.6/universe_create_sectors.php b/templates/Default/admin/Default/1.6/universe_create_sectors.php
index a4feded13..86a7b1af4 100644
--- a/templates/Default/admin/Default/1.6/universe_create_sectors.php
+++ b/templates/Default/admin/Default/1.6/universe_create_sectors.php
@@ -23,7 +23,7 @@
|