diff --git a/admin/Default/1.6/universe_create_locations.php b/admin/Default/1.6/universe_create_locations.php index 12dab84f0..69b5e9b9f 100644 --- a/admin/Default/1.6/universe_create_locations.php +++ b/admin/Default/1.6/universe_create_locations.php @@ -1,11 +1,11 @@ getTypeID()] = 0; } @@ -46,28 +46,25 @@ public function added($locID) { // Set any extra information to be displayed with each location $locText = array(); $categories = new Categories(); -foreach ($locations as &$location) { +foreach ($locations as $location) { $extra = '
'; if ($location->isWeaponSold()) { $extra .= $categories->addLoc($location->getTypeID(), 'Weapons'); - $weaponsSold =& $location->getWeaponsSold(); - foreach($weaponsSold as &$weapon) { + foreach ($location->getWeaponsSold() as $weapon) { $extra .= $weapon->getName() . '   (' . $weapon->getShieldDamage() . '/' . $weapon->getArmourDamage() . '/' . $weapon->getBaseAccuracy() . ')
'; - } unset($weapon); + } } if ($location->isShipSold()) { $extra .= $categories->addLoc($location->getTypeID(), 'Ships'); - $shipsSold =& $location->getShipsSold(); - foreach ($shipsSold as &$shipSold) { + foreach ($location->getShipsSold() as $shipSold) { $extra .= $shipSold['Name'] . '
'; - } unset($shipSold); + } } if ($location->isHardwareSold()) { $extra .= $categories->addLoc($location->getTypeID(), 'Hardware'); - $hardwareSold =& $location->getHardwareSold(); - foreach ($hardwareSold as &$hardware) { + foreach ($location->getHardwareSold() as $hardware) { $extra .= $hardware['Name'] . '
'; - } unset($hardware); + } } if ($location->isBar()) { $extra .= $categories->addLoc($location->getTypeID(), 'Bars'); @@ -85,7 +82,7 @@ public function added($locID) { $extra .= '
'; $locText[$location->getTypeID()] = $location->getName() . $extra; -} unset($location); +} $template->assign('LocText', $locText); $template->assign('LocTypes', $categories->locTypes); diff --git a/admin/Default/1.6/universe_create_save_processing.php b/admin/Default/1.6/universe_create_save_processing.php index d0451659b..819acb282 100644 --- a/admin/Default/1.6/universe_create_save_processing.php +++ b/admin/Default/1.6/universe_create_save_processing.php @@ -73,10 +73,10 @@ $galaxy->setMaxForceTime($_POST['forces' . $i] * 3600); } SmrGalaxy::saveGalaxies(); - $galaxies =& SmrGalaxy::getGameGalaxies($var['game_id'],true); - foreach($galaxies as &$galaxy) { + $galaxies = SmrGalaxy::getGameGalaxies($var['game_id'],true); + foreach ($galaxies as $galaxy) { $galaxy->generateSectors(); - } unset($galaxy); + } SmrSector::saveSectors(); $var['message'] = 'Success : Succesfully created galaxies.'; } diff --git a/admin/Default/1.6/universe_create_sector_details.php b/admin/Default/1.6/universe_create_sector_details.php index c0ffbe8d0..749aa6f33 100644 --- a/admin/Default/1.6/universe_create_sector_details.php +++ b/admin/Default/1.6/universe_create_sector_details.php @@ -44,27 +44,25 @@ } $PHP_OUTPUT.= ''; $PHP_OUTPUT.= ''; //goods determined randomly to sway admin abuse $PHP_OUTPUT.= '

'; -$locations =& SmrLocation::getAllLocations(); $sectorLocations =& $sector->getLocations(); for ($i=0;$i'; $PHP_OUTPUT.= ''; - foreach ($locations as &$location) { + foreach (SmrLocation::getAllLocations() as $location) { $PHP_OUTPUT.= ''; - } unset($location); + } $PHP_OUTPUT.= '
'; } diff --git a/engine/Default/bar_galmap_buy.php b/engine/Default/bar_galmap_buy.php index 2b531414c..547c52a92 100644 --- a/engine/Default/bar_galmap_buy.php +++ b/engine/Default/bar_galmap_buy.php @@ -58,10 +58,10 @@ $PHP_OUTPUT.=create_echo_form($container); $PHP_OUTPUT.=('
'); $PHP_OUTPUT.=create_submit('Buy the map'); $PHP_OUTPUT.=(''); diff --git a/engine/Default/course_plot_processing.php b/engine/Default/course_plot_processing.php index 1a6bf4c52..99ec3043a 100644 --- a/engine/Default/course_plot_processing.php +++ b/engine/Default/course_plot_processing.php @@ -21,13 +21,13 @@ $startExists = false; $targetExists = false; -$galaxies =& SmrGalaxy::getGameGalaxies($player->getGameID()); -foreach($galaxies as &$galaxy) { +$galaxies = SmrGalaxy::getGameGalaxies($player->getGameID()); +foreach ($galaxies as $galaxy) { if($galaxy->contains($start)) $startExists = true; if($galaxy->contains($target)) $targetExists = true; -} unset($galaxy); +} if($startExists===false || $targetExists===false) create_error('The sectors have to exist!'); diff --git a/engine/Default/forces_attack_processing.php b/engine/Default/forces_attack_processing.php index c7611cbf4..c1b46e750 100644 --- a/engine/Default/forces_attack_processing.php +++ b/engine/Default/forces_attack_processing.php @@ -63,12 +63,12 @@ $attackers = $player->getSector()->getFightingTradersAgainstForces($player, $bump); //decloak all attackers -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { $attacker->getShip()->decloak(); if (!$bump) { $attacker->setLastSectorID(0); } -} unset($attacker); +} // If mines are bumped, the forces shoot first. Otherwise player shoots first. if ($bump) { @@ -76,11 +76,11 @@ } $results['Attackers'] = array('TotalDamage' => 0); -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { $playerResults =& $attacker->shootForces($forces); $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; -} unset($attacker); +} if (!$bump) { $results['Forces'] =& $forces->shootPlayers($attackers, $bump); diff --git a/engine/Default/planet_attack_processing.php b/engine/Default/planet_attack_processing.php index 3772f6606..1e14d0934 100644 --- a/engine/Default/planet_attack_processing.php +++ b/engine/Default/planet_attack_processing.php @@ -39,20 +39,20 @@ 'Forces' => array(), 'Forced' => false); -$attackers =& $sector->getFightingTradersAgainstPlanet($player, $planet); +$attackers = $sector->getFightingTradersAgainstPlanet($player, $planet); $planet->attackedBy($player,$attackers); //decloak all attackers -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { $attacker->getShip()->decloak(); -} unset($attacker); +} -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { $playerResults =& $attacker->shootPlanet($planet, false); $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; -} unset($attacker); +} $results['Attackers']['Downgrades'] = $planet->checkForDowngrade($results['Attackers']['TotalDamage']); $results['Planet'] =& $planet->shootPlayers($attackers); @@ -87,10 +87,10 @@ } // Update sector messages for attackers -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { if(!$player->equals($attacker)) $db->query('REPLACE INTO sector_message VALUES(' . $attacker->getAccountID() . ',' . $attacker->getGameID() . ',' . $db->escapeString('[ATTACK_RESULTS]'.$logId) . ')'); -} unset($attacker); +} $container = create_container('skeleton.php', 'planet_attack.php'); $container['sector_id'] = $planet->getSectorID(); diff --git a/engine/Default/port_attack_processing.php b/engine/Default/port_attack_processing.php index 01914c929..44b927e97 100644 --- a/engine/Default/port_attack_processing.php +++ b/engine/Default/port_attack_processing.php @@ -34,21 +34,21 @@ 'Forces' => array(), 'Forced' => false); -$attackers =& $sector->getFightingTradersAgainstPort($player, $port); +$attackers = $sector->getFightingTradersAgainstPort($player, $port); $port->attackedBy($player,$attackers); // take the turns and decloak all attackers -foreach($attackers as &$attacker) { +foreach($attackers as $attacker) { $attacker->takeTurns(TURNS_TO_SHOOT_PORT,0); $attacker->getShip()->decloak(); -} unset($attacker); +} -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { $playerResults =& $attacker->shootPort($port); $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; -} unset($attacker); +} $results['Attackers']['Downgrades'] = $port->checkForDowngrade($results['Attackers']['TotalDamage']); $results['Port'] =& $port->shootPlayers($attackers); @@ -61,11 +61,11 @@ $db->query('INSERT INTO combat_logs VALUES(\'\',' . $db->escapeNumber($player->getGameID()) . ',\'PORT\',' . $db->escapeNumber($port->getSectorID()) . ',' . $db->escapeNumber(TIME) . ',' . $db->escapeNumber($player->getAccountID()) . ',' . $db->escapeNumber($player->getAllianceID()) . ','.$db->escapeNumber(ACCOUNT_ID_PORT).',' . $db->escapeNumber(PORT_ALLIANCE_ID) . ',' . $db->escapeBinary(gzcompress($serializedResults)) . ')'); unserialize($serializedResults); //because of references we have to undo this. $logId = $db->escapeString('[ATTACK_RESULTS]'.$db->getInsertID()); -foreach($attackers as &$attacker) { +foreach ($attackers as $attacker) { if(!$player->equals($attacker)) { $db->query('REPLACE INTO sector_message VALUES(' . $db->escapeNumber($attacker->getAccountID()) . ',' . $db->escapeNumber($attacker->getGameID()) . ','.$logId.')'); } -} unset($attacker); +} $container = create_container('skeleton.php','port_attack.php'); diff --git a/engine/Default/sector_jump_processing.php b/engine/Default/sector_jump_processing.php index 58a25ea18..0ce0800ad 100644 --- a/engine/Default/sector_jump_processing.php +++ b/engine/Default/sector_jump_processing.php @@ -41,12 +41,11 @@ } if ($sector->hasForces()) { - $sectorForces =& $sector->getForces(); - foreach($sectorForces as &$forces) { + foreach ($sector->getForces() as $forces) { if($forces->hasMines() && !$player->forceNAPAlliance($forces->getOwner())) { create_error('You cannot jump when there are hostile mines in the sector!'); } - } unset($forces); + } } // create sector object for target sector @@ -103,14 +102,13 @@ // send scout msg $sector->enteringSector($player,MOVEMENT_JUMP); -$sectorForces =& $sector->getForces(); $mineOwnerID = false; -foreach($sectorForces as &$forces) { +foreach ($sector->getForces() as $forces) { if(!$mineOwnerID && $forces->hasMines() && !$player->forceNAPAlliance($forces->getOwner())) { $mineOwnerID = $forces->getOwnerID(); break; } -} unset($forces); +} if($mineOwnerID) { if ($player->hasNewbieTurns()) { $container = create_container('skeleton.php', 'current_sector.php'); diff --git a/engine/Default/sector_scan.php b/engine/Default/sector_scan.php index 4fa40b8b8..6dd7d09e9 100644 --- a/engine/Default/sector_scan.php +++ b/engine/Default/sector_scan.php @@ -15,17 +15,15 @@ $enemy_vessel = 0; // iterate over all forces in the target sector -$scanSectorAllForces =& $scanSector->getForces(); -foreach ($scanSectorAllForces as &$scanSectorForces) { +foreach ($scanSector->getForces() as $scanSectorForces) { // decide if it's a friendly or enemy stack if ($player->sameAlliance($scanSectorForces->getOwner())) $friendly_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); else $enemy_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); -} unset($scanSectorForces); +} -$scanSectorPlayers =& $scanSector->getOtherTraders($player); -foreach($scanSectorPlayers as &$scanSectorPlayer) { +foreach ($scanSector->getOtherTraders($player) as $scanSectorPlayer) { $scanSectorShip =& $scanSectorPlayer->getShip(); // he's a friend if he's in our alliance (and we are not in a 0 alliance @@ -33,7 +31,7 @@ $friendly_vessel += $scanSectorShip->getAttackRating(); else $enemy_vessel += $scanSectorShip->getDefenseRating() * 10; -} unset($scanSectorPlayer); +} $PHP_OUTPUT.=('

'); $PHP_OUTPUT.=(''); diff --git a/engine/Default/trader_attack_processing.php b/engine/Default/trader_attack_processing.php index 87020468d..e201a603c 100644 --- a/engine/Default/trader_attack_processing.php +++ b/engine/Default/trader_attack_processing.php @@ -26,14 +26,14 @@ else if($targetPlayer->hasFederalProtection()) create_error('Target is under federal protection.'); -$fightingPlayers =& $sector->getFightingTraders($player,$targetPlayer); +$fightingPlayers = $sector->getFightingTraders($player,$targetPlayer); //decloak all fighters -foreach($fightingPlayers as &$teamPlayers) { - foreach($teamPlayers as &$teamPlayer) { +foreach ($fightingPlayers as $teamPlayers) { + foreach ($teamPlayers as $teamPlayer) { $teamPlayer->getShip()->decloak(); - } unset($teamPlayer); -} unset($teamPlayers); + } +} // Take off the 3 turns for attacking $player->takeTurns(3); @@ -41,16 +41,16 @@ $results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0), 'Defenders' => array('Traders' => array(), 'TotalDamage' => 0)); -foreach($fightingPlayers['Attackers'] as $accountID => &$teamPlayer) { +foreach ($fightingPlayers['Attackers'] as $accountID => $teamPlayer) { $playerResults =& $teamPlayer->shootPlayers($fightingPlayers['Defenders']); $results['Attackers']['Traders'][$teamPlayer->getAccountID()] =& $playerResults; $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; -} unset($teamPlayer); -foreach($fightingPlayers['Defenders'] as $accountID => &$teamPlayer) { +} +foreach ($fightingPlayers['Defenders'] as $accountID => $teamPlayer) { $playerResults =& $teamPlayer->shootPlayers($fightingPlayers['Attackers']); $results['Defenders']['Traders'][$teamPlayer->getAccountID()] =& $playerResults; $results['Defenders']['TotalDamage'] += $playerResults['TotalDamage']; -} unset($teamPlayer); +} $ship->removeUnderAttack(); //Don't show attacker the under attack message. $account->log(LOG_TYPE_TRADER_COMBAT, 'Player attacks player, their team does ' . $results['Attackers']['TotalDamage'].' and the other team does '.$results['Defenders']['TotalDamage'], $sector->getSectorID()); diff --git a/templates/Default/engine/Default/GalaxyMap.inc b/templates/Default/engine/Default/GalaxyMap.inc index 0f894564a..9c2e448f1 100644 --- a/templates/Default/engine/Default/GalaxyMap.inc +++ b/templates/Default/engine/Default/GalaxyMap.inc @@ -24,12 +24,12 @@     diff --git a/templates/Default/engine/Default/alliance_message_view.php b/templates/Default/engine/Default/alliance_message_view.php index 889c50f8a..33df81758 100644 --- a/templates/Default/engine/Default/alliance_message_view.php +++ b/templates/Default/engine/Default/alliance_message_view.php @@ -38,7 +38,7 @@ ?> + foreach ($Thread['Replies'] as $Reply) { ?> @@ -47,7 +47,7 @@ ?> + } ?>
Delete
@@ -63,4 +63,4 @@   \ No newline at end of file +?> diff --git a/templates/Default/engine/Default/course_plot.php b/templates/Default/engine/Default/course_plot.php index 8c873322b..bc8487c93 100644 --- a/templates/Default/engine/Default/course_plot.php +++ b/templates/Default/engine/Default/course_plot.php @@ -32,24 +32,24 @@ + } ?>

  diff --git a/templates/Default/engine/Default/feature_request_comments.php b/templates/Default/engine/Default/feature_request_comments.php index 6614f050c..e152beea6 100644 --- a/templates/Default/engine/Default/feature_request_comments.php +++ b/templates/Default/engine/Default/feature_request_comments.php @@ -6,7 +6,7 @@ Comment Time + foreach ($Comments as $Comment) { ?> + } ?> Player Experience &$RankedPlayer) { ?> + foreach ($ExperienceRankings as $Rank => $RankedPlayer) { ?> getPlayerName(); ?> getExperience()); ?> + } ?> @@ -147,13 +147,13 @@ Player Kills &$RankedPlayer) { ?> + foreach ($KillRankings as $Rank => $RankedPlayer) { ?> getPlayerName(); ?> getKills()); ?> + } ?> diff --git a/templates/Default/engine/Default/includes/RightPanelShip.inc b/templates/Default/engine/Default/includes/RightPanelShip.inc index 8b96cf4c2..2dc93cdef 100644 --- a/templates/Default/engine/Default/includes/RightPanelShip.inc +++ b/templates/Default/engine/Default/includes/RightPanelShip.inc @@ -80,10 +80,9 @@ if(isset($GameID)) { ?> Show/Hide (getNumWeapons(); ?>)
isDisplayWeapons()){ ?>style="display: none;">getWeapons(); - foreach($Weapons as &$Weapon) { + foreach ($ThisShip->getWeapons() as $Weapon) { echo $Weapon->getName(); ?>
+ } ?>
+ foreach ($MapSectors as $MapSector) { ?> equals($Sector); $isLinkedSector = !$UniGen && $ThisSector->isLinkedSector($Sector); $isSeedlistSector = !$UniGen && isset($ShowSeedlistSectors) && $ShowSeedlistSectors && $MapPlayer->getAlliance()->isInSeedlist($Sector); @@ -149,11 +149,11 @@ } ?> + } ?> + } ?> diff --git a/templates/Default/engine/Default/shop_ship.php b/templates/Default/engine/Default/shop_ship.php index 7908a78ee..a076a07d7 100644 --- a/templates/Default/engine/Default/shop_ship.php +++ b/templates/Default/engine/Default/shop_ship.php @@ -7,7 +7,7 @@ Cost Action + foreach ($ShipsSold as $ShipSold) { ?> @@ -17,7 +17,7 @@ \ No newline at end of file +} ?> diff --git a/templates/Default/engine/Default/shop_weapon.php b/templates/Default/engine/Default/shop_weapon.php index 274d1caf7..53f2d13a0 100644 --- a/templates/Default/engine/Default/shop_weapon.php +++ b/templates/Default/engine/Default/shop_weapon.php @@ -15,8 +15,7 @@ getWeaponsSold(); - foreach($WeaponsSold as &$Weapon) { ?> + foreach ($ThisLocation->getWeaponsSold() as $Weapon) { ?> getName(); ?> getShieldDamage(); ?> @@ -28,7 +27,7 @@ Buy + } ?> @@ -53,13 +52,12 @@ Cash Action getWeapons(); - foreach ($ShipWeapons as $OrderID => &$Weapon) { ?> + foreach ($ThisShip->getWeapons() as $OrderID => $Weapon) { ?> getName(); ?> getCost() * WEAPON_REFUND_PERCENT)); ?> Sell + } ?>