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 @@

-getShip(); ?> +getShip(); ?> -
@@ -33,7 +33,7 @@ Weapon:

Current DetailsgetShip(); - $ShipWeapons =& $Ship->getWeapons(); ?> + $Ship = $Dummy->getShip(); + $ShipWeapons = $Ship->getWeapons(); ?>
Level: getLevelID(); ?>
Ship: getName(); ?> (getAttackRating(); ?>/getDefenseRating(); ?>)
DCS: hasDCS()){ ?>YesNo
- Weapons: * getName(); ?>
* getName(); ?>
No Dummy
\ No newline at end of file + diff --git a/templates/Default/engine/Default/includes/ForcesCombatResults.inc b/templates/Default/engine/Default/includes/ForcesCombatResults.inc index 1cf515c1d..c286cf51e 100644 --- a/templates/Default/engine/Default/includes/ForcesCombatResults.inc +++ b/templates/Default/engine/Default/includes/ForcesCombatResults.inc @@ -61,7 +61,7 @@ if(isset($ForcesCombatResults['Results']) && is_array($ForcesCombatResults['Resu } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$ForceResults['KillResults'],'TargetPlayer'=>&$TargetPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$ForceResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); } } } diff --git a/templates/Default/engine/Default/includes/PlanetCombatResults.inc b/templates/Default/engine/Default/includes/PlanetCombatResults.inc index 3100080f7..4c04c9911 100644 --- a/templates/Default/engine/Default/includes/PlanetCombatResults.inc +++ b/templates/Default/engine/Default/includes/PlanetCombatResults.inc @@ -61,7 +61,7 @@ if(isset($PlanetCombatResults['Weapons']) && is_array($PlanetCombatResults['Weap } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$WeaponResults['KillResults'],'TargetPlayer'=>&$TargetPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); } } } @@ -116,7 +116,7 @@ if(isset($PlanetCombatResults['Drones'])) { } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$Drones['KillResults'],'TargetPlayer'=>&$TargetPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer)); } } diff --git a/templates/Default/engine/Default/includes/PlanetTraderTeamCombatResults.inc b/templates/Default/engine/Default/includes/PlanetTraderTeamCombatResults.inc index 03848bae2..006c80b17 100644 --- a/templates/Default/engine/Default/includes/PlanetTraderTeamCombatResults.inc +++ b/templates/Default/engine/Default/includes/PlanetTraderTeamCombatResults.inc @@ -67,7 +67,7 @@ foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { } ?>.
includeTemplate('includes/PlanetKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlanet'=>&$TargetPlanet)); + $this->includeTemplate('includes/PlanetKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlanet'=>$TargetPlanet)); } } } @@ -126,7 +126,7 @@ foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { } ?>.
includeTemplate('includes/PlanetKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlanet'=>&$TargetPlanet)); + $this->includeTemplate('includes/PlanetKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlanet'=>$TargetPlanet)); } } } diff --git a/templates/Default/engine/Default/includes/PortCombatResults.inc b/templates/Default/engine/Default/includes/PortCombatResults.inc index c42eb9370..363e02775 100644 --- a/templates/Default/engine/Default/includes/PortCombatResults.inc +++ b/templates/Default/engine/Default/includes/PortCombatResults.inc @@ -61,7 +61,7 @@ if(isset($PortCombatResults['Weapons']) && is_array($PortCombatResults['Weapons' } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$WeaponResults['KillResults'],'TargetPlayer'=>&$TargetPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); } } } @@ -116,7 +116,7 @@ if(isset($PortCombatResults['Drones'])) { } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$Drones['KillResults'],'TargetPlayer'=>&$TargetPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer)); } } diff --git a/templates/Default/engine/Default/includes/PortTraderTeamCombatResults.inc b/templates/Default/engine/Default/includes/PortTraderTeamCombatResults.inc index 54b3901a6..3466e64ee 100644 --- a/templates/Default/engine/Default/includes/PortTraderTeamCombatResults.inc +++ b/templates/Default/engine/Default/includes/PortTraderTeamCombatResults.inc @@ -67,7 +67,7 @@ foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { } ?>.
includeTemplate('includes/PortKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPort'=>&$TargetPort,'ShootingPlayer'=>&$ShootingPlayer)); + $this->includeTemplate('includes/PortKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPort'=>$TargetPort,'ShootingPlayer'=>$ShootingPlayer)); } } } @@ -127,7 +127,7 @@ foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { } ?>.
includeTemplate('includes/PortKillMessage.inc',array('KillResults'=>&$Drones['KillResults'],'TargetPort'=>&$TargetPort,'ShootingPlayer'=>&$ShootingPlayer)); + $this->includeTemplate('includes/PortKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPort'=>$TargetPort,'ShootingPlayer'=>$ShootingPlayer)); } } } diff --git a/templates/Default/engine/Default/includes/RightPanelShip.inc b/templates/Default/engine/Default/includes/RightPanelShip.inc index 8173efafe..9a6e29732 100644 --- a/templates/Default/engine/Default/includes/RightPanelShip.inc +++ b/templates/Default/engine/Default/includes/RightPanelShip.inc @@ -69,7 +69,7 @@ if(isset($GameID)) { ?> hasCargo()) { foreach($ThisShip->getCargo() as $GoodID => $GoodAmount) { - $Good =& Globals::getGood($GoodID); ?> + $Good = Globals::getGood($GoodID); ?> <?php echo $Good['Name']; ?> :
diff --git a/templates/Default/engine/Default/includes/SectorForces.inc b/templates/Default/engine/Default/includes/SectorForces.inc index 6fc4d4cc5..514a69044 100644 --- a/templates/Default/engine/Default/includes/SectorForces.inc +++ b/templates/Default/engine/Default/includes/SectorForces.inc @@ -1,6 +1,6 @@
hasForces()) { - $Forces =& $ThisSector->getForces(); + $Forces = $ThisSector->getForces(); Sorter::sortByNumMethod($Forces,'getExpire'); $RefreshAny = false; ?> diff --git a/templates/Default/engine/Default/includes/SectorMap.inc b/templates/Default/engine/Default/includes/SectorMap.inc index 6cdfc2c7b..72612c8c8 100644 --- a/templates/Default/engine/Default/includes/SectorMap.inc +++ b/templates/Default/engine/Default/includes/SectorMap.inc @@ -58,10 +58,10 @@ } if((($UniGen || $isCurrentSector) && $Sector->hasPort()) || $Sector->hasCachedPort($MapPlayer)) { if(($UniGen || $isCurrentSector) && $Sector->hasPort()) { - $Port =& $Sector->getPort(); + $Port = $Sector->getPort(); } else if($Sector->hasCachedPort($MapPlayer)) { - $Port =& $Sector->getCachedPort($MapPlayer); + $Port = $Sector->getCachedPort($MapPlayer); } ?>
getRaceName(); ?>)" title="Buy (getRaceName(); ?>)" class="portgetRaceID(); ?>"/>getVisibleGoodsSold($MapPlayer) as $GoodID) { - $Good =& Globals::getGood($GoodID); ?> + $Good = Globals::getGood($GoodID); ?> <?php echo $Good['Name']; ?>
Sell (<?php echo $Port->getRaceName(); ?>)getVisibleGoodsBought($MapPlayer) as $GoodID) { - $Good =& Globals::getGood($GoodID); ?> + $Good = Globals::getGood($GoodID); ?> <?php echo $Good['Name']; ?> diff --git a/templates/Default/engine/Default/includes/SectorPort.inc b/templates/Default/engine/Default/includes/SectorPort.inc index 5ab3b663f..d131b5328 100644 --- a/templates/Default/engine/Default/includes/SectorPort.inc +++ b/templates/Default/engine/Default/includes/SectorPort.inc @@ -13,13 +13,13 @@ BuygetVisibleGoodsSold($ThisPlayer) as $GoodID) { - $Good =& Globals::getGood($GoodID); + $Good = Globals::getGood($GoodID); ?><?php echo $Good['Name']; ?>
SellgetVisibleGoodsBought($ThisPlayer) as $GoodID) { - $Good =& Globals::getGood($GoodID); + $Good = Globals::getGood($GoodID); ?><?php echo $Good['Name']; ?>
diff --git a/templates/Default/engine/Default/includes/TraderTeamCombatResults.inc b/templates/Default/engine/Default/includes/TraderTeamCombatResults.inc index 9a2dfcffb..bd208fcc2 100644 --- a/templates/Default/engine/Default/includes/TraderTeamCombatResults.inc +++ b/templates/Default/engine/Default/includes/TraderTeamCombatResults.inc @@ -62,7 +62,7 @@ if(is_array($TraderTeamCombatResults['Traders'])) { } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$WeaponResults['KillResults'],'TargetPlayer'=>&$TargetPlayer,'ShootingPlayer'=>&$ShootingPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer,'ShootingPlayer'=>$ShootingPlayer)); } } } @@ -121,7 +121,7 @@ if(is_array($TraderTeamCombatResults['Traders'])) { } ?>.
includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>&$Drones['KillResults'],'TargetPlayer'=>&$TargetPlayer,'ShootingPlayer'=>&$ShootingPlayer)); + $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer,'ShootingPlayer'=>$ShootingPlayer)); } } } diff --git a/templates/Default/engine/Default/planet_list.inc b/templates/Default/engine/Default/planet_list.inc index 009d405b8..875a7c5e6 100644 --- a/templates/Default/engine/Default/planet_list.inc +++ b/templates/Default/engine/Default/planet_list.inc @@ -18,6 +18,6 @@ if (!$PlayerOnly) { ?> getAllianceName(true); ?> currently has in the universe!

includeTemplate($ExtraInclude, array('Planets'=>&$AllPlanets)); + $this->includeTemplate($ExtraInclude, array('Planets'=>$AllPlanets)); } ?> diff --git a/templates/Default/engine/Default/planet_main.php b/templates/Default/engine/Default/planet_main.php index 0284500ce..052e8fafe 100644 --- a/templates/Default/engine/Default/planet_main.php +++ b/templates/Default/engine/Default/planet_main.php @@ -101,5 +101,5 @@
includeTemplate('includes/SectorPlayers.inc',array('PlayersContainer'=>&$ThisPlanet)); +$this->includeTemplate('includes/SectorPlayers.inc',array('PlayersContainer'=>$ThisPlanet)); ?> diff --git a/templates/Default/engine/Default/port_loot.php b/templates/Default/engine/Default/port_loot.php index 3dc0653e7..6258dbb17 100644 --- a/templates/Default/engine/Default/port_loot.php +++ b/templates/Default/engine/Default/port_loot.php @@ -7,7 +7,7 @@ getVisibleGoodsBought($ThisPlayer); + $BoughtGoodIDs = $ThisPort->getVisibleGoodsBought($ThisPlayer); foreach ($BoughtGoodIDs as $GoodID) { $Good = Globals::getGood($GoodID); $Amount = $ThisPort->getGoodAmount($GoodID); ?> diff --git a/templates/Default/engine/Default/trader_planet.php b/templates/Default/engine/Default/trader_planet.php index 09579a714..b20dcf5d6 100644 --- a/templates/Default/engine/Default/trader_planet.php +++ b/templates/Default/engine/Default/trader_planet.php @@ -1,7 +1,7 @@
0) { - $this->includeTemplate('includes/PlanetList.inc',array('Planets'=>&$TraderPlanets)); + $this->includeTemplate('includes/PlanetList.inc',array('Planets'=>$TraderPlanets)); } else { ?>You don't have a planet claimed!

hasAlliance()) { if (count($AlliancePlanets) > 0) { - $this->includeTemplate('includes/PlanetList.inc',array('Planets'=>&$AlliancePlanets)); + $this->includeTemplate('includes/PlanetList.inc',array('Planets'=>$AlliancePlanets)); } elseif (count($TraderPlanets) == 0) { ?>Your alliance has no claimed planets!getField('registered_nick'); // get alliance_id and game_id for this channel - $alliance =& SmrAlliance::getAllianceByIrcChannel($channel, true); + $alliance = SmrAlliance::getAllianceByIrcChannel($channel, true); if ($alliance == null) { if($validationMessages === true) { fputs($fp, 'PRIVMSG ' . $channel . ' :' . $nick . ', the channel ' . $channel . ' has not been registered with me.' . EOL); diff --git a/tools/npc/chess.php b/tools/npc/chess.php index a3e3d956a..3c7847d36 100644 --- a/tools/npc/chess.php +++ b/tools/npc/chess.php @@ -51,8 +51,7 @@ function writeToEngine($s, $block = true, $read = true) { runkit_constant_redefine('MICRO_TIME', microtime(true)); runkit_constant_redefine('TIME', intval(MICRO_TIME)); - $chessGames =& ChessGame::getNPCMoveGames(true); - foreach($chessGames as &$chessGame) { + foreach (ChessGame::getNPCMoveGames(true) as $chessGame) { debug('Looking at game: ' . $chessGame->getChessGameID()); writeToEngine('position fen ' . $chessGame->getFENString(), false); writeToEngine('go ' . ($chessGame->getCurrentTurnColour() == ChessGame::PLAYER_WHITE ? 'w' : 'b') . 'time ' . UCI_TIME_PER_MOVE_MS, true, false); diff --git a/tools/npc/npc.php b/tools/npc/npc.php index c457da630..d3b96b755 100644 --- a/tools/npc/npc.php +++ b/tools/npc/npc.php @@ -179,7 +179,7 @@ function NPCStuff() { &&($fedContainer==null?$fedContainer = plotToFed($player,true):$fedContainer)!==true) { //We're under attack and need to plot course to fed. // Get the lock, remove under attack and update. acquire_lock($player->getSectorID()); - $ship =& $player->getShip(true); + $ship = $player->getShip(true); $ship->removeUnderAttack(); $ship->updateHardware(); release_lock(); @@ -215,7 +215,7 @@ function NPCStuff() { debug('We are in fed, time to switch to another NPC.'); changeNPCLogin(); } - $ship =& $player->getShip(); + $ship = $player->getShip(); processContainer(plotToFed($player,!$ship->hasMaxShields()||!$ship->hasMaxArmour()||!$ship->hasMaxCargoHolds())); } else if(($container = checkForShipUpgrade($player))!==false) { //We have money and are at a uno, let's uno! @@ -240,12 +240,12 @@ function NPCStuff() { $sellRoute =& $forwardRoute; } - $ship =& $player->getShip(); + $ship = $player->getShip(); if($ship->getUsedHolds()>0) { if($ship->hasCargo($sellRoute->getGoodID())) { //Sell goods $goodID = $sellRoute->getGoodID(); - $port =& $player->getSector()->getPort(); + $port = $player->getSector()->getPort(); $tradeable = checkPortTradeable($port,$player); if($tradeable===true && $port->getGoodAmount($goodID)>=$ship->getCargo($sellRoute->getGoodID())) { //TODO: Sell what we can rather than forcing sell all at once? @@ -278,7 +278,7 @@ function NPCStuff() { else { //Buy goods $goodID = $buyRoute->getGoodID(); - $port =& $player->getSector()->getPort(); + $port = $player->getSector()->getPort(); $tradeable = checkPortTradeable($port,$player); if($tradeable===true && $port->getGoodAmount($goodID)>=$ship->getEmptyHolds()) { //Buy goods @@ -474,10 +474,10 @@ function changeNPCLogin() { function canWeUNO(AbstractSmrPlayer &$player, $oppurtunisticOnly) { if($player->getCredits()getShip(); + $ship = $player->getShip(); if($ship->hasMaxShields()&&$ship->hasMaxArmour()&&$ship->hasMaxCargoHolds()) return false; - $sector =& $player->getSector(); + $sector = $player->getSector(); // We buy armour in preference to shields as it's cheaper. // We buy cargo holds last if we have no newbie turns because we'd rather not die @@ -485,10 +485,9 @@ function canWeUNO(AbstractSmrPlayer &$player, $oppurtunisticOnly) { $amount = 0; - $locations =& $sector->getLocations(); - foreach($locations as &$location) { + foreach ($sector->getLocations() as $location) { if($location->isHardwareSold()) { - $hardwareSold =& $location->getHardwareSold(); + $hardwareSold = $location->getHardwareSold(); if($player->getNewbieTurns() > MIN_NEWBIE_TURNS_TO_BUY_CARGO && !$ship->hasMaxCargoHolds() && isset($hardwareSold[HARDWARE_CARGO]) && ($amount = floor(($player->getCredits()-MINUMUM_RESERVE_CREDITS)/Globals::getHardwareCost(HARDWARE_CARGO))) > 0) { // Buy cargo holds first if we have plenty of newbie turns left. $hardwareID = HARDWARE_CARGO; } @@ -528,7 +527,7 @@ function doUNO($hardwareID,$amount) { function tradeGoods($goodID,AbstractSmrPlayer &$player,SmrPort &$port) { sleepNPC(); //We have an extra sleep at port to make the NPC more vulnerable. - $ship =& $player->getShip(); + $ship = $player->getShip(); $relations = $player->getRelation($port->getRaceID()); $transaction = $port->getGoodTransaction($goodID); @@ -546,8 +545,8 @@ function tradeGoods($goodID,AbstractSmrPlayer &$player,SmrPort &$port) { } function dumpCargo(&$player) { - $ship =& $player->getShip(); - $cargo =& $ship->getCargo(); + $ship = $player->getShip(); + $cargo = $ship->getCargo(); debug('Ship Cargo',$cargo); foreach($cargo as $goodID => $amount) { if($amount > 0) { @@ -667,24 +666,20 @@ function leaveAlliance() { function &findRoutes(&$player) { debug('Finding Routes'); - $galaxies =& SmrGalaxy::getGameGalaxies($player->getGameID()); - $tradeGoods = array(GOOD_NOTHING => false); - $goods =& Globals::getGoods(); - foreach($goods as $goodID => &$good) { + foreach (Globals::getGoods() as $goodID => $good) { if($player->meetsAlignmentRestriction($good['AlignRestriction'])) $tradeGoods[$goodID] = true; else $tradeGoods[$goodID] = false; - } unset($good); + } $tradeRaces = array(); - $races =& Globals::getRaces(); - foreach($races as $raceID => &$race) { + foreach (Globals::getRaces() as $raceID => $race) { $tradeRaces[$raceID] = false; - } unset($race); + } $tradeRaces[$player->getRaceID()] = true; - $galaxy =& $player->getSector()->getGalaxy(); + $galaxy = $player->getSector()->getGalaxy(); $maxNumberOfPorts = 2; $routesForPort=-1; @@ -704,9 +699,9 @@ function &findRoutes(&$player) { else { debug('Generating Routes'); $allSectors = array(); - foreach($galaxies as &$galaxy) { + foreach (SmrGalaxy::getGameGalaxies($player->getGameID()) as $galaxy) { $allSectors += $galaxy->getSectors(); //Merge arrays - } unset($galaxy); + } $distances =& Plotter::calculatePortToPortDistances($allSectors,$maxDistance,$startSectorID,$endSectorID); diff --git a/tools/rerunChessGames.php b/tools/rerunChessGames.php index 5db1f6ab8..8a1416fd2 100644 --- a/tools/rerunChessGames.php +++ b/tools/rerunChessGames.php @@ -8,7 +8,7 @@ $db->query('SELECT chess_game_id FROM chess_game'); while($db->nextRecord()) { $chessGameID = $db->getInt('chess_game_id'); - $game =& ChessGame::getChessGame($chessGameID); + $game = ChessGame::getChessGame($chessGameID); echo 'Running game ' . $chessGameID . ' for white id "' . $game->getWhiteID() . '", black id "' . $game->getBlackID() .'", winner "' . $game->getWinner() . '"' . EOL; echoChessMoves($game); diff --git a/tools/testRouteGen.php b/tools/testRouteGen.php index 88bba9f87..5c1944a95 100644 --- a/tools/testRouteGen.php +++ b/tools/testRouteGen.php @@ -13,12 +13,10 @@ class X{} $gameID = 108; -$galaxies =& SmrGalaxy::getGameGalaxies($gameID); $allSectors = array(); -foreach($galaxies as &$galaxy) -{ +foreach (SmrGalaxy::getGameGalaxies($gameID) as $galaxy) { $allSectors = $allSectors + $galaxy->getSectors(); -} unset($galaxy); +} $maxNumberOfPorts = 2; $goods = array(true,true,true,true,false,false,false,false,false,false,false,false,false);
Amount to Trade Action