From 5a570989def76fe349b28d50fcfc55dffba37fd6 Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" <74361521+FatihKoz@users.noreply.github.com> Date: Mon, 1 Feb 2021 23:27:22 +0300 Subject: [PATCH] Failsafe for SimBrief random pax generation (#1015) * Failsafe for SimBrief random pax generation PR fixes the problem for 0 load generation where va admins do not set load factor and variance values for their flights and also leave the general settings empty. In such cases, both loadmin and loadmax was returning 0 , resulting zero load. Thanks @macofallico for figuring this out. * StyleFix --- app/Http/Controllers/Frontend/SimBriefController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/Frontend/SimBriefController.php b/app/Http/Controllers/Frontend/SimBriefController.php index 58b26658..b9be0d52 100644 --- a/app/Http/Controllers/Frontend/SimBriefController.php +++ b/app/Http/Controllers/Frontend/SimBriefController.php @@ -109,6 +109,11 @@ class SimBriefController $loadmax = $lfactor + $lfactorv; $loadmax = $loadmax > 100 ? 100 : $loadmax; + // Failsafe for admins not defining load values for their flights + // and also leave the general settings empty, set loadmax to 100 + if ($loadmax === 0) { + $loadmax = 100; + } // Show the main simbrief form return view('flights.simbrief_form', [