diff --git a/includes/classes/class.FleetFunctions.php b/includes/classes/class.FleetFunctions.php index 4941690b0..0bc41c55d 100644 --- a/includes/classes/class.FleetFunctions.php +++ b/includes/classes/class.FleetFunctions.php @@ -342,11 +342,10 @@ public static function SendFleetBack($USER, $FleetID) } } - if($fleetResult['fleet_mission'] == 5){ - $fleetEndTime = ($fleetResult['fleet_start_time'] - $fleetResult['start_time']) + TIMESTAMP; - }else{ - $fleetEndTime = (TIMESTAMP - $fleetResult['start_time']) + TIMESTAMP; - } + $returnTimes = array(TIMESTAMP - $fleetResult['start_time'], + $fleetResult['fleet_start_time'] - $fleetResult['start_time']); + + $fleetEndTime = TIMESTAMP + min($returnTimes); $sql = 'UPDATE %%FLEETS%%, %%FLEETS_EVENT%% SET fleet_group = :fleetGroup,