Skip to content

Commit

Permalink
GH-139 More code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed May 30, 2022
1 parent 4527e9b commit 16422d9
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions fleet2.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,23 +321,19 @@
$_Lang['consumption'] = (string)($consumption + 0);
$_Lang['ShowConsumption'] = prettyNumber($consumption);
$_Lang['totalstorage'] = (string)($Fleet['storage'] + 0);
if($Fleet['FuelStorage'] >= $consumption)
{
$_Lang['FuelStorageReduce'] = $consumption;
}
else
{
$_Lang['FuelStorageReduce'] = $Fleet['FuelStorage'];
}

$TempCeil = ceil($consumption / 2);
if($Fleet['FuelStorage'] >= $TempCeil)
{
$_Lang['FuelStorageReduceH'] = $TempCeil;
}
else
{
$_Lang['FuelStorageReduceH'] = $Fleet['FuelStorage'];
}

$_Lang['FuelStorageReduce'] = (
($Fleet['FuelStorage'] >= $consumption) ?
$consumption :
$Fleet['FuelStorage']
);
$_Lang['FuelStorageReduceH'] = (
($Fleet['FuelStorage'] >= $TempCeil) ?
$TempCeil :
$Fleet['FuelStorage']
);
$_Lang['freeStorage'] = (string)($Fleet['storage'] - $consumption + $_Lang['FuelStorageReduce'] + 0);
$_Lang['FuelStorageReduce'] = (string)($_Lang['FuelStorageReduce'] + 0);
$_Lang['FuelStorageReduceH'] = (string)($_Lang['FuelStorageReduceH'] + 0);
Expand Down Expand Up @@ -472,14 +468,12 @@
{
$_Lang['P_HideExpeditionTimers'] = $Hide;
}
if ($targetInfo['isPlanetOwnerNonAggressiveAllianceMember'])
{
$_Lang['Insert_AllyPact_AttackWarn'] = 'true';
}
else
{
$_Lang['Insert_AllyPact_AttackWarn'] = 'false';
}

$_Lang['Insert_AllyPact_AttackWarn'] = (
$targetInfo['isPlanetOwnerNonAggressiveAllianceMember'] ?
'true' :
'false'
);

$availableHoldTimes = FlightControl\Utils\Helpers\getAvailableHoldTimes([]);

Expand Down

0 comments on commit 16422d9

Please sign in to comment.