Completed
Push — work-fleets ( 17c73c...5437e0 )
by SuperNova.WS
05:14
created
includes/classes/Fleet.php 2 patches
Doc Comments   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
   /**
946 946
    * Set current resource list from array of units
947 947
    *
948
-   * @param array $resource_list
948
+   * @param integer[] $resource_list
949 949
    */
950 950
   public function resourcesSet($resource_list) {
951 951
     if (!empty($this->propertiesAdjusted['resource_list'])) {
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
   }
994 994
 
995 995
   /**
996
-   * @param array $rate
996
+   * @param integer[] $rate
997 997
    *
998 998
    * @return float
999 999
    */
@@ -1024,7 +1024,6 @@  discard block
 block discarded – undo
1024 1024
    * Restores fleet or resources to planet
1025 1025
    *
1026 1026
    * @param bool $start
1027
-   * @param bool $only_resources
1028 1027
    * @param int  $result
1029 1028
    *
1030 1029
    * @return int
@@ -1075,7 +1074,7 @@  discard block
 block discarded – undo
1075 1074
   /**
1076 1075
    * @param int $speed_percent
1077 1076
    *
1078
-   * @return array
1077
+   * @return integer
1079 1078
    */
1080 1079
   protected function flt_travel_data($speed_percent = 10) {
1081 1080
     $distance = $this->targetVector->distanceFromCoordinates($this->dbSourcePlanetRow);
@@ -1179,6 +1178,9 @@  discard block
 block discarded – undo
1179 1178
     }
1180 1179
   }
1181 1180
 
1181
+  /**
1182
+   * @param integer $errorCode
1183
+   */
1182 1184
   public function restrictToTypePlanet($errorCode) {
1183 1185
     if ($this->targetVector->type != PT_PLANET) {
1184 1186
       throw new Exception($errorCode, $errorCode);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1656,7 +1656,7 @@  discard block
 block discarded – undo
1656 1656
   protected function renderFleetShortcuts(&$template_result) {
1657 1657
     // Building list of shortcuts
1658 1658
     $query = db_note_list_select_by_owner_and_planet($this->dbOwnerRow);
1659
-    while($row = db_fetch($query)) {
1659
+    while ($row = db_fetch($query)) {
1660 1660
       $template_result['.']['shortcut'][] = $this->renderFleet1TargetSelect($row);
1661 1661
     }
1662 1662
   }
@@ -1686,7 +1686,7 @@  discard block
 block discarded – undo
1686 1686
    */
1687 1687
   protected function renderACSList(&$template_result) {
1688 1688
     $query = db_acs_get_list();
1689
-    while($row = db_fetch($query)) {
1689
+    while ($row = db_fetch($query)) {
1690 1690
       $members = explode(',', $row['eingeladen']);
1691 1691
       foreach ($members as $a => $b) {
1692 1692
         if ($b == $this->dbOwnerRow['id']) {
@@ -1807,8 +1807,7 @@  discard block
 block discarded – undo
1807 1807
     $this->renderAllowedMissions($template_result);
1808 1808
     $this->renderFleet($template_result);
1809 1809
 
1810
-    $max_duration = $this->_mission_type == MT_EXPLORE ? get_player_max_expedition_duration($this->dbOwnerRow) :
1811
-      (isset($this->allowed_missions[MT_HOLD]) ? 12 : 0);
1810
+    $max_duration = $this->_mission_type == MT_EXPLORE ? get_player_max_expedition_duration($this->dbOwnerRow) : (isset($this->allowed_missions[MT_HOLD]) ? 12 : 0);
1812 1811
     $this->renderDuration($template_result, $max_duration);
1813 1812
 
1814 1813
     $travel_data = $this->flt_travel_data($this->oldSpeedInTens);
@@ -2576,8 +2575,8 @@  discard block
 block discarded – undo
2576 2575
    */
2577 2576
   protected function unsetMissionSpyComplex() {
2578 2577
     unset($this->allowed_missions[MT_SPY]);
2579
-    if($this->_mission_type == MT_SPY) {
2580
-      if($this->checkRealFlight()) {
2578
+    if ($this->_mission_type == MT_SPY) {
2579
+      if ($this->checkRealFlight()) {
2581 2580
         return false;
2582 2581
       }
2583 2582
       $this->_mission_type = MT_NONE;
Please login to merge, or discard this patch.
includes/vars.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -333,26 +333,26 @@  discard block
 block discarded – undo
333 333
     // Each mission will filter only necessary checks and do it in this order
334 334
     'mission_checks' => array(
335 335
       // Cheap checks - class Fleet already have all this info internally
336
-      'checkSenderNoVacation'        => FLIGHT_PLAYER_VACATION_OWN,                           //+
337
-      'checkTargetNoVacation'        => FLIGHT_PLAYER_VACATION,                                  //+
338
-      'checkFleetNotEmpty'           => FLIGHT_SHIPS_NO_SHIPS,                                //+
336
+      'checkSenderNoVacation'        => FLIGHT_PLAYER_VACATION_OWN, //+
337
+      'checkTargetNoVacation'        => FLIGHT_PLAYER_VACATION, //+
338
+      'checkFleetNotEmpty'           => FLIGHT_SHIPS_NO_SHIPS, //+
339 339
       // FLIGHT_MISSION_UNKNOWN
340 340
       // FLIGHT_RESOURCES_FORBIDDEN
341
-      'checkSpeedPercentOld'         => FLIGHT_FLEET_SPEED_WRONG,                             //+
342
-      'checkTargetNotSource'         => FLIGHT_VECTOR_SAME_SOURCE,                            //+
341
+      'checkSpeedPercentOld'         => FLIGHT_FLEET_SPEED_WRONG, //+
342
+      'checkTargetNotSource'         => FLIGHT_VECTOR_SAME_SOURCE, //+
343 343
       'checkTargetInUniverse'        => FLIGHT_VECTOR_BEYOND_UNIVERSE,
344
-      'checkUnitsPositive'           => FLIGHT_SHIPS_NEGATIVE,                                //+
344
+      'checkUnitsPositive'           => FLIGHT_SHIPS_NEGATIVE, //+
345 345
       'checkOnlyFleetUnits'          => FLIGHT_SHIPS_UNIT_WRONG,
346
-      'checkOnlyFlyingUnits'         => FLIGHT_SHIPS_UNMOVABLE,                               //+
347
-      'checkResourcesPositive'       => FLIGHT_RESOURCES_NEGATIVE,                            //+
348
-      'checkNotTooFar'               => FLIGHT_FLEET_TOO_FAR,                                //+
349
-      'checkEnoughCapacity'          => FLIGHT_FLEET_OVERLOAD,                                //+
346
+      'checkOnlyFlyingUnits'         => FLIGHT_SHIPS_UNMOVABLE, //+
347
+      'checkResourcesPositive'       => FLIGHT_RESOURCES_NEGATIVE, //+
348
+      'checkNotTooFar'               => FLIGHT_FLEET_TOO_FAR, //+
349
+      'checkEnoughCapacity'          => FLIGHT_FLEET_OVERLOAD, //+
350 350
       // Medium checks - currently requires access to DB but potentially doesn't
351
-      'checkSourceEnoughShips'       => FLIGHT_SHIPS_NOT_ENOUGH,                              //+
352
-      'checkSourceEnoughFuel'        => FLIGHT_RESOURCES_FUEL_NOT_ENOUGH,                     //+
353
-      'checkSourceEnoughResources'   => FLIGHT_RESOURCES_NOT_ENOUGH,                          //+
351
+      'checkSourceEnoughShips'       => FLIGHT_SHIPS_NOT_ENOUGH, //+
352
+      'checkSourceEnoughFuel'        => FLIGHT_RESOURCES_FUEL_NOT_ENOUGH, //+
353
+      'checkSourceEnoughResources'   => FLIGHT_RESOURCES_NOT_ENOUGH, //+
354 354
       // Heavy checks - will absolutely require DB access
355
-      'checkEnoughFleetSlots'        => FLIGHT_FLEET_NO_SLOTS,                                //+
355
+      'checkEnoughFleetSlots'        => FLIGHT_FLEET_NO_SLOTS, //+
356 356
 
357 357
       // Vector targeting space beyond MaxPlanet forces MT_EXPLORE mission
358 358
       'checkKnownSpace'              => array(
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
           'checkNotOnlySpies'   => FLIGHT_SHIPS_NOT_ONLY_SPIES,
363 363
           'checkNoMissiles'     => FLIGHT_SHIPS_NO_MISSILES,
364 364
           'forceMissionExplore' => array(
365
-            true  => FLIGHT_ALLOWED,                                                         //+
365
+            true  => FLIGHT_ALLOWED, //+
366 366
             false => FLIGHT_VECTOR_BEYOND_SYSTEM,
367 367
           ),
368 368
         ),
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
           'checkNoMissiles'      => FLIGHT_SHIPS_NO_MISSILES,
378 378
           'checkTargetIsPlanet'  => FLIGHT_MISSION_COLONIZE_NOT_PLANET,
379 379
           'forceMissionColonize' => array(
380
-            true  => FLIGHT_ALLOWED,                                                         //+
380
+            true  => FLIGHT_ALLOWED, //+
381 381
             false => FLIGHT_VECTOR_NO_TARGET,
382 382
           ),
383 383
         ),
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
       'checkTargetIsDebris'          => array(
389 389
         true => array(
390 390
           // Recycle mission checks
391
-          'checkHaveRecyclers'  => FLIGHT_SHIPS_NO_RECYCLERS,             //+
391
+          'checkHaveRecyclers'  => FLIGHT_SHIPS_NO_RECYCLERS, //+
392 392
           'checkNoMissiles'     => FLIGHT_SHIPS_NO_MISSILES,
393
-          'checkDebrisExists'   => FLIGHT_MISSION_RECYCLE_NO_DEBRIS,    //+
393
+          'checkDebrisExists'   => FLIGHT_MISSION_RECYCLE_NO_DEBRIS, //+
394 394
           'forceMissionRecycle' => array(
395
-            true  => FLIGHT_ALLOWED,                                                                           //+
395
+            true  => FLIGHT_ALLOWED, //+
396 396
             false => FLIGHT_VECTOR_TARGET_DEBRIS,
397 397
           ),
398 398
         ),
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 
489 489
 
490 490
       // Check for multiaccount
491
-      'checkMultiAccount'            => FLIGHT_PLAYER_SAME_IP,                                  //+
491
+      'checkMultiAccount'            => FLIGHT_PLAYER_SAME_IP, //+
492 492
       // TODO - check for moratorium
493 493
 
494 494
 
Please login to merge, or discard this patch.