From 481653da76b10519a4f64db661bcfbeba5c49a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dzieko=C5=84ski?= Date: Wed, 1 Jun 2022 23:11:18 +0200 Subject: [PATCH] GH-139 Further code cleanups --- fleet2.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/fleet2.php b/fleet2.php index 80fb2300..2a5a852e 100644 --- a/fleet2.php +++ b/fleet2.php @@ -3,8 +3,7 @@ define('INSIDE', true); $_EnginePath = './'; -include($_EnginePath.'common.php'); - +include($_EnginePath . 'common.php'); include($_EnginePath . 'modules/flightControl/_includes.php'); use UniEngine\Engine\Modules\Flights; @@ -12,8 +11,16 @@ loggedCheck(); -if((!isset($_POST['sending_fleet']) || $_POST['sending_fleet'] != '1') && (!isset($_POST['fromEnd']) || $_POST['fromEnd'] != '1')) -{ +if ( + ( + !isset($_POST['sending_fleet']) || + $_POST['sending_fleet'] != '1' + ) && + ( + !isset($_POST['fromEnd']) || + $_POST['fromEnd'] != '1' + ) +) { header('Location: fleet.php'); safeDie(); } @@ -301,14 +308,11 @@ $_Lang['TitlePos'] = ($_Planet['planet_type'] == 1 ? $_Lang['fl2_sendfromplanet'] : $_Lang['fl2_sendfrommoon'])." {$_Planet['name']} [{$_Planet['galaxy']}:{$_Planet['system']}:{$_Planet['planet']}]"; $_Lang['FleetArray'] = $_POST['FleetArray']; -if($_POST['quickres'] == '1') -{ - $_Lang['P_SetQuickRes']= '1'; -} -else -{ - $_Lang['P_SetQuickRes']= '0'; -} +$_Lang['P_SetQuickRes'] = ( + ($_POST['quickres'] == '1') ? + '1' : + '0' +); $_Lang['Now'] = $Now; $_Lang['This_metal'] = explode('.', sprintf('%f', floor($_Planet['metal']))); $_Lang['This_metal'] = (string)$_Lang['This_metal'][0];