We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ -32,11 +32,16 @@ discard block | ||
| 32 | 32 | $ship->increaseHardware($hardware_id, $amount); | 
| 33 | 33 | |
| 34 | 34 | //HoF | 
| 35 | -	if ($hardware_id == HARDWARE_COMBAT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); | |
| 36 | -	if ($hardware_id == HARDWARE_SCOUT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); | |
| 37 | -	if ($hardware_id == HARDWARE_MINE) $player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); | |
| 38 | -} | |
| 39 | -else if ($action == 'Sell') { | |
| 35 | +	if ($hardware_id == HARDWARE_COMBAT) { | |
| 36 | +		$player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); | |
| 37 | + } | |
| 38 | +	if ($hardware_id == HARDWARE_SCOUT) { | |
| 39 | +		$player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); | |
| 40 | + } | |
| 41 | +	if ($hardware_id == HARDWARE_MINE) { | |
| 42 | +		$player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); | |
| 43 | + } | |
| 44 | +	} else if ($action == 'Sell') { | |
| 40 | 45 | // We only allow selling combat drones | 
| 41 | 46 |  	if ($hardware_id != HARDWARE_COMBAT) { | 
| 42 | 47 |  		throw new Exception('This item cannot be sold!'); | 
| @@ -49,8 +54,7 @@ discard block | ||
| 49 | 54 | |
| 50 | 55 | $player->increaseCredits(IRound($cost * CDS_REFUND_PERCENT) * $amount); | 
| 51 | 56 | $ship->decreaseCDs($amount, true); // 2nd arg avoids under attack warning | 
| 52 | -} | |
| 53 | -else { | |
| 57 | +} else { | |
| 54 | 58 |  	throw new Exception('Action must be either Buy or Sell.'); | 
| 55 | 59 | } | 
| 56 | 60 | |
| @@ -301,7 +301,7 @@ discard block | ||
| 301 | 301 |  	public function setWeaponLocations(array $orderArray) { | 
| 302 | 302 | $weapons = $this->weapons; | 
| 303 | 303 |  		foreach ($orderArray as $newOrder => $oldOrder) { | 
| 304 | - $this->weapons[$newOrder] =& $weapons[$oldOrder]; | |
| 304 | + $this->weapons[$newOrder] = & $weapons[$oldOrder]; | |
| 305 | 305 | } | 
| 306 | 306 | $this->hasChangedWeapons = true; | 
| 307 | 307 | } | 
| @@ -901,14 +901,14 @@ discard block | ||
| 901 | 901 | } | 
| 902 | 902 | $results['DeadBeforeShot'] = false; | 
| 903 | 903 |  		foreach ($this->weapons as $orderID => $weapon) { | 
| 904 | - $results['Weapons'][$orderID] =& $weapon->shootPlayer($thisPlayer, $targetPlayers[array_rand($targetPlayers)]); | |
| 904 | + $results['Weapons'][$orderID] = & $weapon->shootPlayer($thisPlayer, $targetPlayers[array_rand($targetPlayers)]); | |
| 905 | 905 |  			if ($results['Weapons'][$orderID]['Hit']) { | 
| 906 | 906 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; | 
| 907 | 907 | } | 
| 908 | 908 | } | 
| 909 | 909 |  		if ($this->hasCDs()) { | 
| 910 | 910 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); | 
| 911 | - $results['Drones'] =& $thisCDs->shootPlayer($thisPlayer, $targetPlayers[array_rand($targetPlayers)]); | |
| 911 | + $results['Drones'] = & $thisCDs->shootPlayer($thisPlayer, $targetPlayers[array_rand($targetPlayers)]); | |
| 912 | 912 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; | 
| 913 | 913 | } | 
| 914 | 914 | $thisPlayer->increaseExperience(IRound($results['TotalDamage'] * self::EXP_PER_DAMAGE_PLAYER)); | 
| @@ -926,7 +926,7 @@ discard block | ||
| 926 | 926 | } | 
| 927 | 927 | $results['DeadBeforeShot'] = false; | 
| 928 | 928 |  		foreach ($this->weapons as $orderID => $weapon) { | 
| 929 | - $results['Weapons'][$orderID] =& $weapon->shootForces($thisPlayer, $forces); | |
| 929 | + $results['Weapons'][$orderID] = & $weapon->shootForces($thisPlayer, $forces); | |
| 930 | 930 |  			if ($results['Weapons'][$orderID]['Hit']) { | 
| 931 | 931 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; | 
| 932 | 932 |  				$thisPlayer->increaseHOF($results['Weapons'][$orderID]['ActualDamage']['NumMines'], array('Combat', 'Forces', 'Mines', 'Killed'), HOF_PUBLIC); | 
| @@ -940,7 +940,7 @@ discard block | ||
| 940 | 940 | } | 
| 941 | 941 |  		if ($this->hasCDs()) { | 
| 942 | 942 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); | 
| 943 | - $results['Drones'] =& $thisCDs->shootForces($thisPlayer, $forces); | |
| 943 | + $results['Drones'] = & $thisCDs->shootForces($thisPlayer, $forces); | |
| 944 | 944 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; | 
| 945 | 945 |  			$thisPlayer->increaseHOF($results['Drones']['ActualDamage']['NumMines'], array('Combat', 'Forces', 'Mines', 'Killed'), HOF_PUBLIC); | 
| 946 | 946 |  			$thisPlayer->increaseHOF($results['Drones']['ActualDamage']['Mines'], array('Combat', 'Forces', 'Mines', 'Damage Done'), HOF_PUBLIC); | 
| @@ -965,14 +965,14 @@ discard block | ||
| 965 | 965 | } | 
| 966 | 966 | $results['DeadBeforeShot'] = false; | 
| 967 | 967 |  		foreach ($this->weapons as $orderID => $weapon) { | 
| 968 | - $results['Weapons'][$orderID] =& $weapon->shootPort($thisPlayer, $port); | |
| 968 | + $results['Weapons'][$orderID] = & $weapon->shootPort($thisPlayer, $port); | |
| 969 | 969 |  			if ($results['Weapons'][$orderID]['Hit']) { | 
| 970 | 970 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; | 
| 971 | 971 | } | 
| 972 | 972 | } | 
| 973 | 973 |  		if ($this->hasCDs()) { | 
| 974 | 974 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); | 
| 975 | - $results['Drones'] =& $thisCDs->shootPort($thisPlayer, $port); | |
| 975 | + $results['Drones'] = & $thisCDs->shootPort($thisPlayer, $port); | |
| 976 | 976 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; | 
| 977 | 977 | } | 
| 978 | 978 | $thisPlayer->increaseExperience(IRound($results['TotalDamage'] * self::EXP_PER_DAMAGE_PORT)); | 
| @@ -1003,14 +1003,14 @@ discard block | ||
| 1003 | 1003 | } | 
| 1004 | 1004 | $results['DeadBeforeShot'] = false; | 
| 1005 | 1005 |  		foreach ($this->weapons as $orderID => $weapon) { | 
| 1006 | - $results['Weapons'][$orderID] =& $weapon->shootPlanet($thisPlayer, $planet, $delayed); | |
| 1006 | + $results['Weapons'][$orderID] = & $weapon->shootPlanet($thisPlayer, $planet, $delayed); | |
| 1007 | 1007 |  			if ($results['Weapons'][$orderID]['Hit']) { | 
| 1008 | 1008 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; | 
| 1009 | 1009 | } | 
| 1010 | 1010 | } | 
| 1011 | 1011 |  		if ($this->hasCDs()) { | 
| 1012 | 1012 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); | 
| 1013 | - $results['Drones'] =& $thisCDs->shootPlanet($thisPlayer, $planet, $delayed); | |
| 1013 | + $results['Drones'] = & $thisCDs->shootPlanet($thisPlayer, $planet, $delayed); | |
| 1014 | 1014 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; | 
| 1015 | 1015 | } | 
| 1016 | 1016 | $thisPlayer->increaseExperience(IRound($results['TotalDamage'] * self::EXP_PER_DAMAGE_PLANET)); | 
| @@ -12,7 +12,7 @@ discard block | ||
| 12 | 12 | protected $maxDamage; | 
| 13 | 13 | protected $shieldDamage; | 
| 14 | 14 | protected $armourDamage; | 
| 15 | - protected $empDamage=0; | |
| 15 | + protected $empDamage = 0; | |
| 16 | 16 | protected $accuracy; | 
| 17 | 17 | protected $damageRollover; | 
| 18 | 18 | protected $raidWeapon; | 
| @@ -85,68 +85,68 @@ discard block | ||
| 85 | 85 | abstract public function &getModifiedForceDamageAgainstPlayer(SmrForce $forces, AbstractSmrPlayer $targetPlayer); | 
| 86 | 86 | |
| 87 | 87 |  	protected function &doPlayerDamageToForce(array &$return, AbstractSmrPlayer $weaponPlayer, SmrForce $forces) { | 
| 88 | - $return['WeaponDamage'] =& $this->getModifiedDamageAgainstForces($weaponPlayer,$forces); | |
| 89 | - $return['ActualDamage'] =& $forces->doWeaponDamage($return['WeaponDamage']); | |
| 90 | -		if($return['ActualDamage']['KillingShot']) { | |
| 91 | - $return['KillResults'] =& $forces->killForcesByPlayer($weaponPlayer); | |
| 88 | + $return['WeaponDamage'] = & $this->getModifiedDamageAgainstForces($weaponPlayer, $forces); | |
| 89 | + $return['ActualDamage'] = & $forces->doWeaponDamage($return['WeaponDamage']); | |
| 90 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 91 | + $return['KillResults'] = & $forces->killForcesByPlayer($weaponPlayer); | |
| 92 | 92 | } | 
| 93 | 93 | return $return; | 
| 94 | 94 | } | 
| 95 | 95 | |
| 96 | 96 |  	protected function &doPlayerDamageToPlayer(array &$return, AbstractSmrPlayer $weaponPlayer, AbstractSmrPlayer $targetPlayer) { | 
| 97 | - $return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlayer($weaponPlayer,$targetPlayer); | |
| 98 | - $return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 97 | + $return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlayer($weaponPlayer, $targetPlayer); | |
| 98 | + $return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 99 | 99 | |
| 100 | -		if($return['ActualDamage']['KillingShot']) { | |
| 101 | - $return['KillResults'] =& $targetPlayer->killPlayerByPlayer($weaponPlayer); | |
| 100 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 101 | + $return['KillResults'] = & $targetPlayer->killPlayerByPlayer($weaponPlayer); | |
| 102 | 102 | } | 
| 103 | 103 | return $return; | 
| 104 | 104 | } | 
| 105 | 105 | |
| 106 | 106 |  	protected function &doPlayerDamageToPort(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPort $port) { | 
| 107 | - $return['WeaponDamage'] =& $this->getModifiedDamageAgainstPort($weaponPlayer,$port); | |
| 108 | - $return['ActualDamage'] =& $port->doWeaponDamage($return['WeaponDamage']); | |
| 109 | -		if($return['ActualDamage']['KillingShot']) { | |
| 110 | - $return['KillResults'] =& $port->killPortByPlayer($weaponPlayer); | |
| 107 | + $return['WeaponDamage'] = & $this->getModifiedDamageAgainstPort($weaponPlayer, $port); | |
| 108 | + $return['ActualDamage'] = & $port->doWeaponDamage($return['WeaponDamage']); | |
| 109 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 110 | + $return['KillResults'] = & $port->killPortByPlayer($weaponPlayer); | |
| 111 | 111 | } | 
| 112 | 112 | return $return; | 
| 113 | 113 | } | 
| 114 | 114 | |
| 115 | 115 |  	protected function &doPlayerDamageToPlanet(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet, $delayed) { | 
| 116 | - $return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlanet($weaponPlayer,$planet); | |
| 117 | - $return['ActualDamage'] =& $planet->doWeaponDamage($return['WeaponDamage'],$delayed); | |
| 118 | -		if($return['ActualDamage']['KillingShot']) { | |
| 119 | - $return['KillResults'] =& $planet->killPlanetByPlayer($weaponPlayer); | |
| 116 | + $return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlanet($weaponPlayer, $planet); | |
| 117 | + $return['ActualDamage'] = & $planet->doWeaponDamage($return['WeaponDamage'], $delayed); | |
| 118 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 119 | + $return['KillResults'] = & $planet->killPlanetByPlayer($weaponPlayer); | |
| 120 | 120 | } | 
| 121 | 121 | return $return; | 
| 122 | 122 | } | 
| 123 | 123 | |
| 124 | 124 |  	protected function &doPortDamageToPlayer(array &$return, SmrPort $port, AbstractSmrPlayer $targetPlayer) { | 
| 125 | - $return['WeaponDamage'] =& $this->getModifiedPortDamageAgainstPlayer($port,$targetPlayer); | |
| 126 | - $return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 125 | + $return['WeaponDamage'] = & $this->getModifiedPortDamageAgainstPlayer($port, $targetPlayer); | |
| 126 | + $return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 127 | 127 | |
| 128 | -		if($return['ActualDamage']['KillingShot']) { | |
| 129 | - $return['KillResults'] =& $targetPlayer->killPlayerByPort($port); | |
| 128 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 129 | + $return['KillResults'] = & $targetPlayer->killPlayerByPort($port); | |
| 130 | 130 | } | 
| 131 | 131 | return $return; | 
| 132 | 132 | } | 
| 133 | 133 | |
| 134 | 134 |  	protected function &doPlanetDamageToPlayer(array &$return, SmrPlanet $planet, AbstractSmrPlayer $targetPlayer) { | 
| 135 | - $return['WeaponDamage'] =& $this->getModifiedPlanetDamageAgainstPlayer($planet,$targetPlayer); | |
| 136 | - $return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 135 | + $return['WeaponDamage'] = & $this->getModifiedPlanetDamageAgainstPlayer($planet, $targetPlayer); | |
| 136 | + $return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 137 | 137 | |
| 138 | -		if($return['ActualDamage']['KillingShot']) { | |
| 139 | - $return['KillResults'] =& $targetPlayer->killPlayerByPlanet($planet); | |
| 138 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 139 | + $return['KillResults'] = & $targetPlayer->killPlayerByPlanet($planet); | |
| 140 | 140 | } | 
| 141 | 141 | return $return; | 
| 142 | 142 | } | 
| 143 | 143 | |
| 144 | 144 |  	protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer) { | 
| 145 | - $return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces,$targetPlayer); | |
| 146 | - $return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 145 | + $return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer); | |
| 146 | + $return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); | |
| 147 | 147 | |
| 148 | -		if($return['ActualDamage']['KillingShot']) { | |
| 149 | - $return['KillResults'] =& $targetPlayer->killPlayerByForces($forces); | |
| 148 | +		if ($return['ActualDamage']['KillingShot']) { | |
| 149 | + $return['KillResults'] = & $targetPlayer->killPlayerByForces($forces); | |
| 150 | 150 | } | 
| 151 | 151 | return $return; | 
| 152 | 152 | } | 
| @@ -929,8 +929,8 @@ discard block | ||
| 929 | 929 | } | 
| 930 | 930 | self::$HOFVis[$hofType] = $visibility; | 
| 931 | 931 | |
| 932 | - $hof =& $this->HOF; | |
| 933 | - $hofChanged =& $this->hasHOFChanged; | |
| 932 | + $hof = & $this->HOF; | |
| 933 | + $hofChanged = & $this->hasHOFChanged; | |
| 934 | 934 | $new = false; | 
| 935 | 935 |  		foreach ($typeList as $type) { | 
| 936 | 936 |  			if (!isset($hofChanged[$type])) { | 
| @@ -940,8 +940,8 @@ discard block | ||
| 940 | 940 | $hof[$type] = array(); | 
| 941 | 941 | $new = true; | 
| 942 | 942 | } | 
| 943 | - $hof =& $hof[$type]; | |
| 944 | - $hofChanged =& $hofChanged[$type]; | |
| 943 | + $hof = & $hof[$type]; | |
| 944 | + $hofChanged = & $hofChanged[$type]; | |
| 945 | 945 | } | 
| 946 | 946 |  		if ($hofChanged == null) { | 
| 947 | 947 | $hofChanged = self::HOF_CHANGED; | 
| @@ -1097,7 +1097,7 @@ discard block | ||
| 1097 | 1097 | } | 
| 1098 | 1098 | |
| 1099 | 1099 |  	private function setupMissionStep($missionID) { | 
| 1100 | - $mission =& $this->missions[$missionID]; | |
| 1100 | + $mission = & $this->missions[$missionID]; | |
| 1101 | 1101 |  		if ($mission['On Step'] >= count(MISSIONS[$missionID]['Steps'])) { | 
| 1102 | 1102 | // Nothing to do if this mission is already completed | 
| 1103 | 1103 | return; | 
| @@ -1142,7 +1142,7 @@ discard block | ||
| 1142 | 1142 | 'Starting Sector' => $this->getSectorID() | 
| 1143 | 1143 | ); | 
| 1144 | 1144 | |
| 1145 | - $this->missions[$missionID] =& $mission; | |
| 1145 | + $this->missions[$missionID] = & $mission; | |
| 1146 | 1146 | $this->setupMissionStep($missionID); | 
| 1147 | 1147 | $this->rebuildMission($missionID); | 
| 1148 | 1148 | |
| @@ -1201,7 +1201,7 @@ discard block | ||
| 1201 | 1201 | |
| 1202 | 1202 |  	public function claimMissionReward($missionID) { | 
| 1203 | 1203 | $this->getMissions(); | 
| 1204 | - $mission =& $this->missions[$missionID]; | |
| 1204 | + $mission = & $this->missions[$missionID]; | |
| 1205 | 1205 |  		if ($mission === false) { | 
| 1206 | 1206 |  			throw new Exception('Unknown mission: ' . $missionID); | 
| 1207 | 1207 | } | 
| @@ -104,13 +104,15 @@ | ||
| 104 | 104 | $numberOfPlanets = $_POST['type' . $planetTypeID]; | 
| 105 | 105 |  		for ($i = 1; $i <= $numberOfPlanets; $i++) { | 
| 106 | 106 | $galSector = $galSectors[array_rand($galSectors)]; | 
| 107 | - while ($galSector->hasPlanet()) $galSector = $galSectors[array_rand($galSectors)]; //1 per sector | |
| 107 | +			while ($galSector->hasPlanet()) { | |
| 108 | + $galSector = $galSectors[array_rand($galSectors)]; | |
| 109 | + } | |
| 110 | + //1 per sector | |
| 108 | 111 | $galSector->createPlanet($planetTypeID); | 
| 109 | 112 | } | 
| 110 | 113 | } | 
| 111 | 114 | $var['message'] = '<span class="green">Success</span> : Succesfully added planets.'; | 
| 112 | -} | |
| 113 | -elseif ($submit == 'Create Ports') { | |
| 115 | +} elseif ($submit == 'Create Ports') { | |
| 114 | 116 | $numLevelPorts = []; | 
| 115 | 117 |  	for ($i = 1; $i <= SmrPort::MAX_LEVEL; $i++) { | 
| 116 | 118 | $numLevelPorts[$i] = $_REQUEST['port' . $i] ?? 0; | 
| @@ -363,26 +363,26 @@ | ||
| 363 | 363 | } | 
| 364 | 364 | |
| 365 | 365 |  	public function isNPC() { | 
| 366 | -		if(!isset($this->npc)) { | |
| 367 | -			$this->db->query('SELECT login FROM npc_logins WHERE login = '.$this->db->escapeString($this->getLogin()).' LIMIT 1;'); | |
| 366 | +		if (!isset($this->npc)) { | |
| 367 | +			$this->db->query('SELECT login FROM npc_logins WHERE login = ' . $this->db->escapeString($this->getLogin()) . ' LIMIT 1;'); | |
| 368 | 368 | $this->npc = $this->db->nextRecord(); | 
| 369 | 369 | } | 
| 370 | 370 | return $this->npc; | 
| 371 | 371 | } | 
| 372 | 372 | |
| 373 | 373 |  	protected function getHOFData() { | 
| 374 | -		if(!isset($this->HOF)) { | |
| 374 | +		if (!isset($this->HOF)) { | |
| 375 | 375 | //Get Player HOF | 
| 376 | 376 |  			$this->db->query('SELECT type,sum(amount) as amount FROM player_hof WHERE ' . $this->SQL . ' AND game_id IN (SELECT game_id FROM game WHERE ignore_stats = \'FALSE\') GROUP BY type'); | 
| 377 | 377 | $this->HOF = array(); | 
| 378 | -			while($this->db->nextRecord()) { | |
| 379 | - $hof =& $this->HOF; | |
| 380 | -				$typeList = explode(':',$this->db->getField('type')); | |
| 381 | -				foreach($typeList as $type) { | |
| 382 | -					if(!isset($hof[$type])) { | |
| 378 | +			while ($this->db->nextRecord()) { | |
| 379 | + $hof = & $this->HOF; | |
| 380 | +				$typeList = explode(':', $this->db->getField('type')); | |
| 381 | +				foreach ($typeList as $type) { | |
| 382 | +					if (!isset($hof[$type])) { | |
| 383 | 383 | $hof[$type] = array(); | 
| 384 | 384 | } | 
| 385 | - $hof =& $hof[$type]; | |
| 385 | + $hof = & $hof[$type]; | |
| 386 | 386 | } | 
| 387 | 387 |  				$hof = $this->db->getFloat('amount'); | 
| 388 | 388 | } | 
| @@ -132,7 +132,7 @@ discard block | ||
| 132 | 132 | // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. | 
| 133 | 133 |  			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 134 | 134 | } | 
| 135 | - $damage =& $this->getModifiedDamage(); | |
| 135 | + $damage = & $this->getModifiedDamage(); | |
| 136 | 136 | $damage['Launched'] = ICeil($this->getNumberOfCDs() * $this->getModifiedAccuracyAgainstForces($weaponPlayer, $forces) / 100); | 
| 137 | 137 | $damage['Kamikaze'] = 0; | 
| 138 | 138 |  		if ($weaponPlayer->isCombatDronesKamikazeOnMines()) { // If kamikaze then damage is same as MINE_ARMOUR | 
| @@ -156,7 +156,7 @@ discard block | ||
| 156 | 156 | // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. | 
| 157 | 157 |  			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 158 | 158 | } | 
| 159 | - $damage =& $this->getModifiedDamage(); | |
| 159 | + $damage = & $this->getModifiedDamage(); | |
| 160 | 160 | $damage['Launched'] = ICeil($this->getNumberOfCDs() * $this->getModifiedAccuracyAgainstPort($weaponPlayer, $port) / 100); | 
| 161 | 161 | $damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage']); | 
| 162 | 162 | $damage['Shield'] = ICeil($damage['Launched'] * $damage['Shield']); | 
| @@ -170,7 +170,7 @@ discard block | ||
| 170 | 170 | // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. | 
| 171 | 171 |  			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 172 | 172 | } | 
| 173 | - $damage =& $this->getModifiedDamage(); | |
| 173 | + $damage = & $this->getModifiedDamage(); | |
| 174 | 174 | $damage['Launched'] = ICeil($this->getNumberOfCDs() * $this->getModifiedAccuracyAgainstPlanet($weaponPlayer, $planet) / 100); | 
| 175 | 175 | $planetMod = self::PLANET_DAMAGE_MOD; | 
| 176 | 176 | $damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage'] * $planetMod); | 
| @@ -185,7 +185,7 @@ discard block | ||
| 185 | 185 |  			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 186 | 186 | return $return; | 
| 187 | 187 | } | 
| 188 | - $damage =& $this->getModifiedDamage(); | |
| 188 | + $damage = & $this->getModifiedDamage(); | |
| 189 | 189 |  		if ($targetPlayer->getShip()->hasDCS()) { | 
| 190 | 190 | $damage['MaxDamage'] *= DCS_PLAYER_DAMAGE_DECIMAL_PERCENT; | 
| 191 | 191 | $damage['Shield'] *= DCS_PLAYER_DAMAGE_DECIMAL_PERCENT; | 
| @@ -203,7 +203,7 @@ discard block | ||
| 203 | 203 |  			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 204 | 204 | return $return; | 
| 205 | 205 | } | 
| 206 | - $damage =& $this->getModifiedDamage(); | |
| 206 | + $damage = & $this->getModifiedDamage(); | |
| 207 | 207 | |
| 208 | 208 |  		if ($targetPlayer->getShip()->hasDCS()) { | 
| 209 | 209 | $damage['MaxDamage'] *= DCS_FORCE_DAMAGE_DECIMAL_PERCENT; | 
| @@ -223,7 +223,7 @@ discard block | ||
| 223 | 223 |  			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 224 | 224 | return $return; | 
| 225 | 225 | } | 
| 226 | - $damage =& $this->getModifiedDamage(); | |
| 226 | + $damage = & $this->getModifiedDamage(); | |
| 227 | 227 | |
| 228 | 228 |  		if ($targetPlayer->getShip()->hasDCS()) { | 
| 229 | 229 | $damage['MaxDamage'] *= DCS_PORT_DAMAGE_DECIMAL_PERCENT; | 
| @@ -242,7 +242,7 @@ discard block | ||
| 242 | 242 |  			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); | 
| 243 | 243 | return $return; | 
| 244 | 244 | } | 
| 245 | - $damage =& $this->getModifiedDamage(); | |
| 245 | + $damage = & $this->getModifiedDamage(); | |
| 246 | 246 | |
| 247 | 247 |  		if ($targetPlayer->getShip()->hasDCS()) { | 
| 248 | 248 | $damage['MaxDamage'] *= DCS_PLANET_DAMAGE_DECIMAL_PERCENT; | 
| @@ -469,8 +469,9 @@ | ||
| 469 | 469 | |
| 470 | 470 | if (!$player->isDead() && $player->getNewbieTurns() <= NEWBIE_TURNS_WARNING_LIMIT && | 
| 471 | 471 | $player->getNewbieWarning() && | 
| 472 | - $var['url'] != 'newbie_warning_processing.php') | |
| 473 | -			forward(create_container('newbie_warning_processing.php')); | |
| 472 | +			$var['url'] != 'newbie_warning_processing.php') { | |
| 473 | +					forward(create_container('newbie_warning_processing.php')); | |
| 474 | + } | |
| 474 | 475 | } | 
| 475 | 476 | |
| 476 | 477 | // Initialize the template | 
| @@ -119,7 +119,7 @@ discard block | ||
| 119 | 119 | } | 
| 120 | 120 | |
| 121 | 121 |  		try { | 
| 122 | - $TRADE_ROUTE =& $GLOBALS['TRADE_ROUTE']; | |
| 122 | + $TRADE_ROUTE = & $GLOBALS['TRADE_ROUTE']; | |
| 123 | 123 |  			debug('Action #' . $actions); | 
| 124 | 124 | |
| 125 | 125 | //We have to reload player on each loop | 
| @@ -138,14 +138,14 @@ discard block | ||
| 138 | 138 | } | 
| 139 | 139 | |
| 140 | 140 |  			if (!isset($TRADE_ROUTE)) { //We only want to change trade route if there isn't already one set. | 
| 141 | - $TRADE_ROUTES =& findRoutes($player); | |
| 142 | - $TRADE_ROUTE =& changeRoute($TRADE_ROUTES); | |
| 141 | + $TRADE_ROUTES = & findRoutes($player); | |
| 142 | + $TRADE_ROUTE = & changeRoute($TRADE_ROUTES); | |
| 143 | 143 | } | 
| 144 | 144 | |
| 145 | 145 |  			if ($player->isDead()) { | 
| 146 | 146 |  				debug('Some evil person killed us, let\'s move on now.'); | 
| 147 | 147 | $previousContainer = null; //We died, we don't care what we were doing beforehand. | 
| 148 | - $TRADE_ROUTE =& changeRoute($TRADE_ROUTES); //Change route | |
| 148 | + $TRADE_ROUTE = & changeRoute($TRADE_ROUTES); //Change route | |
| 149 | 149 |  				processContainer(create_container('death_processing.php')); | 
| 150 | 150 | } | 
| 151 | 151 |  			if ($player->getNewbieTurns() <= NEWBIE_TURNS_WARNING_LIMIT && $player->getNewbieWarning()) { | 
| @@ -227,7 +227,7 @@ discard block | ||
| 227 | 227 | processContainer(tradeGoods($goodID, $player, $port)); | 
| 228 | 228 |  							} else { | 
| 229 | 229 | //Move to next route or fed. | 
| 230 | -								if (($TRADE_ROUTE =& changeRoute($TRADE_ROUTES)) === false) { | |
| 230 | +								if (($TRADE_ROUTE = & changeRoute($TRADE_ROUTES)) === false) { | |
| 231 | 231 |  									debug('Changing Route Failed'); | 
| 232 | 232 | processContainer(plotToFed($player)); | 
| 233 | 233 |  								} else { | 
| @@ -254,7 +254,7 @@ discard block | ||
| 254 | 254 | processContainer(tradeGoods($goodID, $player, $port)); | 
| 255 | 255 |  						} else { | 
| 256 | 256 | //Move to next route or fed. | 
| 257 | -							if (($TRADE_ROUTE =& changeRoute($TRADE_ROUTES)) === false) { | |
| 257 | +							if (($TRADE_ROUTE = & changeRoute($TRADE_ROUTES)) === false) { | |
| 258 | 258 |  								debug('Changing Route Failed'); | 
| 259 | 259 | processContainer(plotToFed($player)); | 
| 260 | 260 |  							} else { | 
| @@ -586,9 +586,9 @@ discard block | ||
| 586 | 586 | return $false; | 
| 587 | 587 | } | 
| 588 | 588 | $routeKey = array_rand($tradeRoutes); | 
| 589 | - $tradeRoute =& $tradeRoutes[$routeKey]; | |
| 589 | + $tradeRoute = & $tradeRoutes[$routeKey]; | |
| 590 | 590 | unset($tradeRoutes[$routeKey]); | 
| 591 | - $GLOBALS['TRADE_ROUTE'] =& $tradeRoute; | |
| 591 | + $GLOBALS['TRADE_ROUTE'] = & $tradeRoute; | |
| 592 | 592 |  	debug('Switched route', $tradeRoute); | 
| 593 | 593 | return $tradeRoute; | 
| 594 | 594 | } |