From 15f6c8dd85dfc72a4ebf9a27d5d3e3b3b85c791e Mon Sep 17 00:00:00 2001 From: MetalStormGhost <89945461+MetalStormGhost@users.noreply.github.com> Date: Fri, 16 Dec 2022 19:59:21 +0200 Subject: [PATCH] Add new performance option: Disable idle aircraft at airfields (#37) --- changelog.md | 1 + game/missiongenerator/aircraft/aircraftgenerator.py | 3 +++ game/settings/settings.py | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/changelog.md b/changelog.md index 604a4f98..847d90c9 100644 --- a/changelog.md +++ b/changelog.md @@ -25,6 +25,7 @@ BAI/ANTISHIP/DEAD/STRIKE/BARCAP/CAS/OCA/AIR-ASSAULT (main) missions * **[Performance]** Added performance option: Maximum front-line unit supply per control point. * **[Performance]** Added performance option: Disable convoys. * **[Performance]** Added performance option: Front-line troops prefer roads. +* **[Performance]** Added performance option: Disable idle aircraft at airfields. * **[Squadrons]** Squadron pilot limits enabled by default. * **[UI]** Add livery selector to Air Wing Configurator's squadrons. diff --git a/game/missiongenerator/aircraft/aircraftgenerator.py b/game/missiongenerator/aircraft/aircraftgenerator.py index c1a93744..f0ce3ed7 100644 --- a/game/missiongenerator/aircraft/aircraftgenerator.py +++ b/game/missiongenerator/aircraft/aircraftgenerator.py @@ -151,6 +151,9 @@ class AircraftGenerator: def _spawn_unused_for( self, squadron: Squadron, country: Country, faction: Faction ) -> None: + if self.game.settings.perf_disable_idle_aircraft: + return + assert isinstance(squadron.location, Airfield) for _ in range(squadron.untasked_aircraft): # Creating a flight even those this isn't a fragged mission lets us diff --git a/game/settings/settings.py b/game/settings/settings.py index 0fa94c6a..c6642994 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -482,6 +482,12 @@ class Settings: section=PERFORMANCE_SECTION, default=True, ) + perf_disable_idle_aircraft: bool = boolean_option( + "Disable idle aircraft at airfields", + page=MISSION_GENERATOR_PAGE, + section=PERFORMANCE_SECTION, + default=False, + ) # Performance culling perf_culling: bool = boolean_option( "Culling of distant units enabled",