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 | |
@@ -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; |
@@ -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 |
@@ -167,11 +167,9 @@ discard block |
||
| 167 | 167 | foreach (self::$expRoutes as $multi => $routesByMulti) { |
| 168 | 168 | if (count($routesByMulti) + $i < $trimToBestXRoutes) { |
| 169 | 169 | $i += count($routesByMulti); |
| 170 | - } |
|
| 171 | - else if ($i > $trimToBestXRoutes) { |
|
| 170 | + } else if ($i > $trimToBestXRoutes) { |
|
| 172 | 171 | unset(self::$expRoutes[$multi]); |
| 173 | - } |
|
| 174 | - else { |
|
| 172 | + } else { |
|
| 175 | 173 | foreach ($routesByMulti as $key => $value) { |
| 176 | 174 | $i++; |
| 177 | 175 | if ($i < $trimToBestXRoutes) { |
@@ -191,12 +189,10 @@ discard block |
||
| 191 | 189 | foreach (self::$moneyRoutes as $multi => $routesByMulti) { |
| 192 | 190 | if (count($routesByMulti) + $i < $trimToBestXRoutes) { |
| 193 | 191 | $i += count($routesByMulti); |
| 194 | - } |
|
| 195 | - else if ($i > $trimToBestXRoutes) { |
|
| 192 | + } else if ($i > $trimToBestXRoutes) { |
|
| 196 | 193 | unset(self::$moneyRoutes[$multi]); |
| 197 | 194 | continue; |
| 198 | - } |
|
| 199 | - else { |
|
| 195 | + } else { |
|
| 200 | 196 | foreach ($routesByMulti as $key => $value) { |
| 201 | 197 | $i++; |
| 202 | 198 | if ($i < $trimToBestXRoutes) { |